Re: error catching and hashes

2004-01-10 Thread Piers Cawley
[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

Re: error catching and hashes

2004-01-10 Thread wren argetlahm
--- Piers Cawley [EMAIL PROTECTED] wrote: This is because 'return undef;' is good, but 'return;' is better. It returns the correct, context dependent representation of false. That seems to have fixed my problem, but I'm not sure why it works. My error($error) is now something to the effect

Re: error catching and hashes

2004-01-10 Thread Bruce Van Allen
On 1/10/04 wren argetlahm wrote: --- Piers Cawley [EMAIL PROTECTED] wrote: This is because 'return undef;' is good, but 'return;' is better. It returns the correct, context dependent representation of false. That seems to have fixed my problem, but I'm not sure why it works. My error($error) is

error catching and hashes

2004-01-09 Thread wren argetlahm
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