The docs for eval suggest this idiom:
# alter $@ on nefarious repugnancy only { my $e; { local $@; # protect existing $@ eval { test_repugnancy() }; # $@ =~ /nefarious/ and die $@; # Perl 5.14 and higher only $@ =~ /nefarious/ and $e = $@; } die $e if defined $e }
In reply to Re^3: eval: Why use the 'Zombie error' idiom?
by hippo
in thread eval: Why use the 'Zombie error' idiom?
by DouglasDD
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |