There's more than one way to do things | |
PerlMonks |
Re: Idomatic Handling of Subroutine Errorby dragonchild (Archbishop) |
on Sep 18, 2001 at 22:40 UTC ( [id://113169]=note: print w/replies, xml ) | Need Help?? |
You're looking for some sort of throw/catch error-handling for special subs.
That's the way Perl does it. Now, for a stylistic note - you shouldn't be doing the eval/$@ syntax for every single function call you make. Keep it for the critical parts of your system. In part, this is because of the overhead of eval. *shrugs* Update: I stand corrected on the overhead. Thanks, btrott! ------ Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.
In Section
Seekers of Perl Wisdom
|
|