develooper Front page | perl.perl5.porters | Postings from November 2011

Re: Autoloading and Preloading

Thread Previous | Thread Next
From:
Zefram
Date:
November 30, 2011 03:42
Subject:
Re: Autoloading and Preloading
Message ID:
20111130114222.GJ6846@lake.fysh.org
demerphq wrote:
>But it would be nice if there was an easy way to tell Perl and Module
>code to preload everything and forget lazy loading.

use less "laziness";

If we standardise on this less.pm keyword meaning that, then any module
can participate in observing it.  A module's ->import method would want
to look for the less-laziness flag in its caller's hint hash.

Unfortunately, the less->of method doesn't actually look there: it
only looks at its immediate caller's hint hash.  less->of("laziness")
will actually only return true when called within the lexical scope of
'use less "laziness";'.  We need a better interface for querying it.
Then we can actually make less.pm useful.

-zefram

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