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

Re: cannot AUTOLOAD a method called VERSION

Thread Previous | Thread Next
Michael G Schwern
October 21, 2003 16:35
Re: cannot AUTOLOAD a method called VERSION
Message ID:
On Tue, Oct 21, 2003 at 01:59:23PM +0100, Dirk Koopman wrote:
> 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?

You're just inheriting VERSION() from UNIVERSAL.  Also isa() and can().

I think the only magical method names with regard to AUTOLOAD are
import() and unimport() and I never really understood the rationale
behind that.

Michael G Schwern
I'm so bored I think I'll buy a gun and shoot geese from my patio
        -- rmah

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About