I have rarely seen the equivalent of a copy constructor in someone's new method. Rather, I've seen the my $class = ref $proto || $proto; trick used to add "make me a new one of these" semantics to the standard "make me a new instance of this package" semantics.
If you're restricted to created instances of a named class, you have extra hoops to jump through to extend your software to accomodate new subclasses. By adding a "make me new one of these" capability, you defer past compile-time the decision of what package to create a new copy of.
In reply to Re: Mmmm ... cargo cult progamming is nummy!
by dws
in thread Adding autoloaded methods to symbol table with using strict refs
by strat
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |