develooper Front page | perl.perl5.porters | Postings from September 2002

Re: [RFC] jit.pm - load modules and subroutines just in time

Thread Previous | Thread Next
From:
Michael G Schwern
Date:
September 28, 2002 23:41
Subject:
Re: [RFC] jit.pm - load modules and subroutines just in time
Message ID:
20020929064107.GC3858@ool-18b93024.dyn.optonline.net
On Sun, Sep 29, 2002 at 12:33:25AM +0200, Elizabeth Mattijsen wrote:
> So the typical use inside a module is to have:
> 
>  package Your::Module;
>  use jit;
> 
> in the source.  And to place all subroutines that you want to be loadable on
> demand after the (first) __END__.

I have a Clever Idea!  The "put things after the __END__ block" hack has
always bothered me about AutoLoader style things.  It would be interesting
if one could write their code normally and just put "use jit" at the top and
it worked.  jit.pm would really be a source filter.  The filter would simply
blow away all the code below "use jit" and install an AUTOLOAD routine.  The
AUTOLOAD would then read from $INC{'Your/Module.pm'} rather than *DATA.


-- 

Michael G. Schwern   <schwern@pobox.com>    http://www.pobox.com/~schwern/
Perl Quality Assurance      <perl-qa@perl.org>         Kwalitee Is Job One
kiloconway: unit of extreme mind expansion.  Equal to 1024 conways,
  one kiloconway gives the sensation that all of the quantuum particles
  in your brain have been spontaneously converted into Mars bars (IN
  CONSTANT TIME!).  The presumed existance of kiloconway scale events
  has led many to believe that higher forms of intelligence do in
  fact exist, and are living quite happily in Rural Australia.
	-- Ziggy

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