in reply to style for returning errors from subroutines
In your example, get_users() will return a list of users, and an empty list means there are none. If there is an error of some kind, the caller doesn't need to know just what and how to check. Instead, the system is pro-active and jumps to the error handler. In Perl that's done with die/eval.
—John
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: style for returning errors from subroutines
by Boldra (Curate) on Jun 15, 2001 at 15:22 UTC |