in reply to Re^2: Carping in DESTROY.
in thread Carping in DESTROY.
It does get thrown — anything after the die won't get executed — but it's intercepted by DESTROY's caller.
my $var = 1; sub A::DESTROY { $var = 2; die 'ok'; $var = 3; } my $obj = bless [], 'A'; $obj = ''; # no exception occurs print "$var\n"; # 2 print "$@\n"; # " (in cleanup) ok at - line 1."
This behaviour isn't new. Tested with 5.6.1
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Carping in DESTROY.
by eff_i_g (Curate) on Oct 24, 2006 at 19:10 UTC | |
by Anonymous Monk on Oct 25, 2006 at 10:32 UTC | |
by eff_i_g (Curate) on Oct 25, 2006 at 14:27 UTC |