Don't ask to ask, just ask | |
PerlMonks |
Re: autoload usageby targetsmart (Curate) |
on Feb 06, 2009 at 17:20 UTC ( [id://741960]=note: print w/replies, xml ) | Need Help?? |
I admire the autoload feature of perl, I generally use this autoload for method making(accessors for object/instance specific get/set variables).
for eg, If you defined your autoload subroutine like above inside any of your package, you are reducing lot of coding, because with the help of above routine you achieve some thing like this.
$SomeObject->name("john");
but defining a sub-routine for every attribute like name, age, address, etc., is quite faster in terms of access than this way of creating subroutine in autoload. But the above method reduces lot of code.
Vivek -- In accordance with the prarabdha of each, the One whose function it is to ordain makes each to act. What will not happen will never happen, whatever effort one may put forth. And what will happen will not fail to happen, however much one may seek to prevent it. This is certain. The part of wisdom therefore is to stay quiet.
In Section
Seekers of Perl Wisdom
|
|