It is a common idiom to place the bless last in 'new' methods, so the new object is returned.The disadvantage of that is that you cannot call methods within the constructor to pick up class-related or instance-related initialization information.
However, that's fairly rare for simple demonstrations. Hence, most people haven't seen the fact that more often in "real life", bless is done fairly early in the constructor, usually as soon as the hashref is constructed.
-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.
In reply to Re^3: What means: "bless { @_ } => $class;"?
by merlyn
in thread What means: "bless { @_ } => $class;"?
by hesco
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |