The hip way of doing this is to use Try::Tiny. Personally, I prefer the following approach, to make sure the code actually died:
my $ok = eval { $mailer->send(...); 1; }; if (! $ok) { my $err = $@; ... };
But even my approach does not explain to me why if( $@ ) would be true but "$@" resp. "$err" would be empty.
In reply to Re: Where did $@ go?
by Corion
in thread Where did $@ go?
by John M. Dlugosz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |