in reply to Re^4: Where did $@ go?
in thread Where did $@ go?

But that doesn't claim anything for the error situation. For example the following will (at least in Perl 5.12, and earlier versions) wipe $@ even though there is an error:

sub Eater::DESTROY { eval { 1 }; }; my $ok = eval { my $foo = bless {}, 'Eater'; die "Booo!"; 1; }; warn "OK: [$ok]"; warn "\$\@: [$@]";

Replies are listed 'Best First'.
Re^6: Where did $@ go?
by John M. Dlugosz (Monsignor) on Mar 21, 2011 at 12:18 UTC
    I see. So the implied "and contains the die message or at least a \n" is messed up due to scope localization issues.

    Maybe that's what's "eating" the string in my case: some kind of destructor. And we should assume such things are happening in a fancy modern class-oriented system.

    But that doesn't explain why it's still "true". Maybe there is some magic involved and it is remembering that there is an uncaught exception even though the string is gone?

    So, are the various "fancy" try/catch systems inter-operable? I'm hoping they are all calling the same underlying class and pending-exception state system?