![]() |
|
There's more than one way to do things | |
PerlMonks |
Re: Where did $@ go?by ELISHEVA (Prior) |
on Mar 21, 2011 at 13:50 UTC ( #894516=note: print w/replies, xml ) | Need Help?? |
an empty string for $@ that tests as true The last time I saw such weirdness (empty string tests as true), my so called empty string contained a null character as its first character. To confirm this print out $@ with Devel::Peek::Dump (see Devel::Peek). As for how that null got there? Anybody's guess. Exiting an eval block triggers the destructors for all data that is no longer needed. If there is an eval in one of those destructors, $@ can be easily reset. I didn't see any DESTROY subroutine in either Mail::Builder::Simple or Mail::Builder. However, Mail::Builder uses Moose which has plenty of magic and there are several other modules involved as well. Any one of them could be doing something that causes $@ to be reset. My own preferred syntax for exception handling is
In Section
Seekers of Perl Wisdom
|
|