R
Rainer Weikusat
As far as I could determine, this isn't documented anywhere, hence, I
thought I should post it: Perl exceptions, including automatically
generated ones caused by attempts to call a non-existant subroutine or
invoke a method using undef as invocant, are not propagated out of
Perl object destructors, ie, the following code
-------------
package Boo;
sub new
{
return bless([], $_[0]);
}
sub DESTROY
{
$_[2]->the_end_of_the_world_lost();
}
package main;
my $o = Boo->new();
$o = undef;
print("So we had to continue ...\n");
------------
will print 'So we had to continue ...' (this caused me quite some head
scratching yesterday because 'some code' on an appliance in Korea
apparently managed to 'escape' from a certain scope without executing
all of the contained code).
thought I should post it: Perl exceptions, including automatically
generated ones caused by attempts to call a non-existant subroutine or
invoke a method using undef as invocant, are not propagated out of
Perl object destructors, ie, the following code
-------------
package Boo;
sub new
{
return bless([], $_[0]);
}
sub DESTROY
{
$_[2]->the_end_of_the_world_lost();
}
package main;
my $o = Boo->new();
$o = undef;
print("So we had to continue ...\n");
------------
will print 'So we had to continue ...' (this caused me quite some head
scratching yesterday because 'some code' on an appliance in Korea
apparently managed to 'escape' from a certain scope without executing
all of the contained code).