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
In reply to Re^3: Carping in DESTROY.
by ikegami
in thread Carping in DESTROY.
by eff_i_g
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |