AUTOLOAD
Dirk Koopman
djk at tobit.co.uk
Sat Jan 13 18:03:22 GMT 2007
Tim Sweetman wrote:
>
> Dealing with AUTOLOAD's effects on inheritance, the can method, and
> other subtleties is enough to make experts go "hmm", consider, talk a
> lot, write utility modules, and debate tickets
> (http://rt.cpan.org/Public/Dist/Display.html?Name=UNIVERSAL-can)
>
> Damian's "Best Practices" say: don't use AUTOLOAD.
>
> I never use it, and recommend people against its use, because once
> inheritance and cans are in the mix, the situation becomes extremely
> unclear.
>
And I say life is too short to code every accessor and not everybody
wants to use one of the modules that are supposed to make this all easier,
usually at the expense of lots of extra overhead.
If one understands what is going on, then there really is no problem
about mixing AUTOLOAD and $foo->can(...). However, I must confess that I
do demarcate methods and accessors quite rigorously.
Dirk
Dirk
More information about the london.pm
mailing list