develooper Front page | perl.perl6.language | Postings from June 2005

Re: AUTLOAD and $_

Thread Previous | Thread Next
From:
chromatic
Date:
June 20, 2005 16:00
Subject:
Re: AUTLOAD and $_
Message ID:
1119308326.21522.91.camel@localhost
On Mon, 2005-06-20 at 16:37 -0600, Luke Palmer wrote:

> On 6/20/05, chromatic <chromatic@wgz.org> wrote:

> > Who says AUTOLOAD will always either call a loaded sub or fail?

> Uh, what else can it do?  It doesn't have to load a sub to return a
> code reference.

I think:

class NullObject
{
	sub AUTOLOAD {}
}

is better than:

class NullObject
{
	sub AUTOLOAD { return sub {} }
}

Or have I misunderstood the proposal and the purpose of AUTOLOAD?

-- c


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