in reply to Re^2: Question about __PACKAGE__
in thread Question about __PACKAGE__
It might be more descriptive to rewrite Foo->new()->hello('test5'); as
This just blesses a CODE_REF for fun. It could be a HASHREF or some other REF. The only real difference betweenbless(\sub {}, 'Foo')->hello('test5');
and'Foo'->hello()
Besides the fact that the blessed version can contain data, is that just before the blessed object is Garbage Collected, DESTROY is called with it as the argument ($x->DESTROY). UNIVERSAL contains a DESTROY method, so it always exists.bless(sub {}, 'Foo')->hello()
|
|---|