Welcome to the Monastery | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
It is important to note that Perl OO does not have any "built in" concept of data. There is no default Constructor and the Destructor consists of a call to DESTROY.
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 between and 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.
-- gam3 A picture is worth a thousand words, but takes 200K. In reply to Re^3: Question about __PACKAGE__
by gam3
|
|