go ahead... be a heretic | |
PerlMonks |
Why <c>eval {...};if ($@) { die $@ } else { ...</c> ???by Jenda (Abbot) |
on Apr 03, 2009 at 21:00 UTC ( [id://755338]=perlquestion: print w/replies, xml ) | Need Help?? |
Jenda has asked for the wisdom of the Perl Monks concerning the following question: I'm probably missing something important here, but ... why would anyone want to write
I mean ... if the something(...) does throw an exception, the code catches the exception only to rethrow it unchanged (I checked that with die "foo", die "foo\n"; and die $object.), if it doesn't something more is done and the result of that something(...) is returned. So as far as I can tell it's equivalent to
Or, if there really is just one expression within the eval{}:
Or not? Am I missing something or is XML::SAX::Base (1.04) cargoculting?
Back to
Seekers of Perl Wisdom
|
|