develooper Front page | perl.perl5.porters | Postings from October 2003

cannot AUTOLOAD a method called VERSION

Thread Next
From:
Dirk Koopman
Date:
October 21, 2003 11:11
Subject:
cannot AUTOLOAD a method called VERSION
Message ID:
1066741163.6663.10.camel@dirk2.int.tobit.co.uk
Sorry to send this direct, the machine that has 5.8.1 on it can't see
the outside world.

It appears that AUTOLOAD will never see a request for a method (an
autogenerated external data dictionary accessor in my case) called
'VERSION'. It will simply bypass it and try to return the (usually
non-existant) scalar $FOO::VERSION (and, failed, the error message
associated with that).

This is fixed by having an explicit method called VERSION in one
of the ancestors (ie: sub VERSION {...}). 

I wonder what other 'magical' names there are?

Dirk
-- 
Please Note: Some Quantum Physics Theories Suggest That When the
Consumer Is Not Directly Observing This Message, It May Cease to
Exist or Will Exist Only in a Vague and Undetermined State.


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About