[EMAIL PROTECTED] (Wren Argetlahm) writes: > I've recently discovered the joys of return undef; for > error catching, but I'm having problems when the > subroutine returns a hash (unless there's an error). > Something like the following: > > %hash = &subroutine($input) or &error($error); > > returns the expected "odd number of elements in hash > assignment" warning. Is there a way around this aside > from returning a hash reference instead? is there any > particular reason to/not to return a reference > instead?
This is because 'return undef;' is good, but 'return;' is better. It returns the correct, context dependent representation of false.