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

cannot AUTOLOAD a method called VERSION

Thread Next
Dirk Koopman
October 21, 2003 11:11
cannot AUTOLOAD a method called VERSION
Message ID:
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?

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 Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About