I am most disappointed to find that if you put a blessed sub-ref in the
symbol table and then replace it, its DESTROY method doesn't get called
straight away:
package Immortal;
sub new { return bless sub { print "called the object\n" }, shift; }
sub DESTROY { print "called DESTROY\n"; }
1;
$ perl -MImmortal -e '*Foo::bar = Immortal->new(); Foo::bar(); *Foo::bar = sub {print "blargh\n"}; Foo::bar();'
called the object
blargh
called DESTROY
looks like the blessed sub continues to exist right to the end of the
process, even though all references to it have gone away. Is this a bug?
--
David Cantrell | A machine for turning tea into grumpiness
comparative and superlative explained:
<Huhn> worse, worser, worsest, worsted, wasted