On 05.07.2017 18:27, Bill Moseley wrote: > Haven't those issues with eval been addressed in more recent versions of > Perl? > > For example, in older Perls this used to reset $@, but now $@ is retained: > > use strict; > use warnings; > > sub Foo::DESTROY { > print "in Foo Destroy\n"; > eval { 1 }; > print "Foo has \$@ as '$@'\n" > return; > } > > eval { > my $foo = bless {}, 'Foo'; > die "BOOM\n"; > }; > print "eval with $@\n"; > > > Returns: > > in Foo Destroy > Foo has $@ as '' > eval with BOOM >
Thomas Klausner in one of his posts provided the following link: http://blog.twoshortplanks.com/2011/06/06/unexceptional-exceptions-in-perl-5-14/ >From reading it, I have got the impression that the behavior in 5.14 has been drastically improved, but that not all problems are solved. I have to re-read, though (being new to exception handling in Perl). Thanks for your help! Regards, Binarus