AUTOLOAD
Andy Armstrong
andy at hexten.net
Tue Jan 16 15:16:27 GMT 2007
On 16 Jan 2007, at 14:36, Dirk Koopman wrote:
> Not that I have tried it ever (because I don't generally need to go
> there) but why can one not call SUPER::AUTOLOAD? AUTOLOAD is just a
> method (albeit a special one with an extra calling convention)
> after all?
Nope. See:
http://search.cpan.org/~tilly/Class-AutoloadCAN-0.03/lib/Class/
AutoloadCAN.pm
"This module solves a fundamental conflict between AUTOLOAD, can and
inheritance. The problem is that while you can implement
anything in
AUTOLOAD, UNIVERSAL::can is not aware that it is there.
Attempting to
modify UNIVERSAL::can to document those methods is very hard.
And if a
parent class uses AUTOLOAD then subclasses have to do a lot of
work to
make their AUTOLOADs cooperate with the parent one. It is harder
still
if 2 parent classes in a multiple inheritance tree wish to
cooperate
with each other. Few try to do this, which may be good since
those who
try usually get it wrong."
and:
http://www.perlmonks.org/?node_id=342804
"This is a personal opinion that chromaticand I have a long-standing
disagreement about. I keep on not promoting it to a root node
because I
don't think that I have time to discuss it right, but since he
keeps
tweaking, I'll give in."
Dammit, that chromatic's a right tinker, eh? :)
--
Andy Armstrong, hexten.net
More information about the london.pm
mailing list