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

Re: cannot AUTOLOAD a method called VERSION

Thread Previous | Thread Next
From:
Michael G Schwern
Date:
October 21, 2003 16:35
Subject:
Re: cannot AUTOLOAD a method called VERSION
Message ID:
20031021233537.GA23006@windhund.schwern.org
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        schwern@pobox.com  http://www.pobox.com/~schwern/
I'm so bored I think I'll buy a gun and shoot geese from my patio
        -- rmah

Thread Previous | 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