http://qs1969.pair.com?node_id=818955

gam3 has asked for the wisdom of the Perl Monks concerning the following question:

I am wondering why it is that
bless(sub {}, 'Foo');
never calls Foo->DESTROY.

And is this a well known feature of Perl OO?

perl -e '{package Foo; sub DESTROY { print "d\n"; } bless( {}, 'Foo'); +}' # d perl -e '{package Foo; sub DESTROY { print "d\n"; } bless(sub {}, 'Foo +');} # no d
-- gam3
A picture is worth a thousand words, but takes 200K.