In article <rt-3.0.11-33940-106489.16.0611746958661@perl.org>, "Victor Porton,,," (via RT) <perlbug-followup@perl.org> writes: > I reasonably detailed scanned perlobj, perltoot, perlbot manpages, > read "die" and "eval" entries in perlfunc and found no answer. > > The questions answer to which seems missing in Perl docs is: > > Consider code: > > eval { > my $obj1 = Class1->new; > { > my $obj2 = Class2->new; > # Suppose Class2->DESTROY calls 'die "2"' > } > # Suppose Class1->DESTROY also 'die "1"' > } > > What is now $@? > > I'd like if ($@ eq "1") after this eval block (outer object to allow > to override inner exception), but I found no warranty for ($@ eq "1") > in Perl docs. > Sorry, it won't do what you want exactly. dies in DESTROY append "\t(in cleanup)error message" to the existing $@. It's documented in a rather obscure place, in perlcall under G_KEEPERR, and rather sideways even there. (you need to read rather carefully to infer it will happen for die in DESTROY) And it has some weird, undocumented and broken trickery to try to avoid duplicate messages too. I agree with you that it deserves a more highlevel explanation in a more visible place.