in reply to Question on "Effective Perl Programming"
According to the eval documentation, "If there was no error, $@ is guaranteed to be a null string." According to True or False? A Quick Reference Guide, the only expressions that would be false but not a null string are undef and 0 (or "0").
I think the only way there could be an error that is not caught by "if ($@)" would be if you were to throw an exception that uses overload to generate a false value in that case. That is to say, I think "if ($@)" would work in every case except where the code in the eval does something deliberately mean or it has a really unlikely bug.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Question on "Effective Perl Programming"
by perrin (Chancellor) on Sep 06, 2007 at 03:33 UTC | |
by kyle (Abbot) on Sep 06, 2007 at 04:01 UTC | |
by perrin (Chancellor) on Sep 06, 2007 at 05:59 UTC | |
by kyle (Abbot) on Sep 06, 2007 at 11:59 UTC | |
by perrin (Chancellor) on Sep 06, 2007 at 12:39 UTC |