in reply to Re: The art of error handling
in thread The art of error handling
I suppose the use of the global vars carried over from C when you were basically stuck returning static variables for multi-variant-byte length information. Of course, Perl does not have this restriction and thus would recommend using returns. My favorite scheme is 0 for success, some string or number on failure- preferably something I might be able to output to the user. This is definitely that something that has come with me from my UN*X C background (POSIX likes to make success 0 now).die "Oops!\n" unless evilfunction(); #or "if", if you prefer
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: The art of error handling
by merlyn (Sage) on Dec 19, 2000 at 21:59 UTC | |
by Hot Pastrami (Monk) on Dec 19, 2000 at 22:04 UTC | |
by mirod (Canon) on Dec 19, 2000 at 22:08 UTC | |
|
Re: Re: Re: The art of error handling
by Hrunting (Pilgrim) on Dec 20, 2000 at 00:35 UTC | |
|
Re: Re: Re: The art of error handling
by jreades (Friar) on Dec 20, 2000 at 00:55 UTC |