On Tue Apr 20 12:35:47 2010, zefram@fysh.org wrote: > > This is a bug report for perl from zefram@vigo.rous.org, > generated with the help of perlbug 1.39 running under perl 5.12.0. > > > ----------------------------------------------------------------- > [Please describe your issue here] > > The G_KEEPERR flag is meant to prevent an exception thrown from within > some code from affecting an outer $@. It is used, for example, when > calling a DESTROY method, as shown here with the End module from CPAN: > > $ perl -MEnd -lwe 'eval { my $x = end { die "aa\n" }; die "bb\n";}; > print "outer err=", $@' > (in cleanup) aa > outer err=bb > (in cleanup) aa > > (This suffers from double reporting, but that's an issue for another > ticket.) However, if the main exception is a non-string object, it > gets > squashed by the cleanup exception: > > $ perl -MEnd -lwe 'eval { my $x = end { die "aa\n" }; die {};}; print > "outer err=", $@' > (in cleanup) aa > outer err= (in cleanup) aa > > This is contrary to the description of G_KEEPERR. A similar outcome, > lacking the warning, occurs if the cleanup exception is not a string: > > $ perl -MEnd -lwe 'eval { my $x = end { die [] }; die "bb\n";}; print > "outer err=", $@' > outer err=ARRAY(0x804e5b0) > $ perl -MEnd -lwe 'eval { my $x = end { die [] }; die {};}; print > "outer err=", $@' > outer err=ARRAY(0x8065c20) > > The KEEPERR logic is very dependent on the exceptions being strings. > perlcall(1) says the flag dates from perl 5.002, so this is > understandable. It needs revision for the brave new world of, er, > 5.005. This was all fixed by your changes, wasn’t it? -- Father Chrysostomos --- via perlbug: queue: perl5 status: new https://rt.perl.org:443/rt3/Ticket/Display.html?id=74538Thread Next