in reply to Re^2: Dealing with errors in subroutines
in thread Dealing with errors in subroutines
use strict; use warnings; use Data::Dumper; sub DESTROY { eval { 1 } } eval { my $obj = bless {}; die "wrong"; }; print Dumper $@; __END__ $VAR1 = '';
The correct solution is to localize $@ in the DESTROY sub, but you can't always rely on third-party modules to do such things correctly.
|
|---|