develooper Front page | perl.perl6.language | Postings from February 2001

Re: Really auto autoloaded modules

Thread Previous | Thread Next
From:
Michael G Schwern
Date:
February 2, 2001 01:34
Subject:
Re: Really auto autoloaded modules
Message ID:
20010201134144.A10625@blackrider.aocn.com
On Thu, Feb 01, 2001 at 12:24:38PM -0600, Dave Rolsky wrote:
> Here's a gross thought (for implementors at least ;)
> 
> If it sees
> 
>  use CGI qw( param header );
> 
> the autoloader could look for a module which implements the 'CGI'
> interface and has those two functions.

Problem is, its extremely difficult to figure out what module
implements what.  Sure, if you see a C<sub foo {...}> you have a
pretty good idea that foo() is implemented, but there's all sorts of
not uncommon tricks which make lexical scanning for subroutines nigh
impossible.  Consider Class::Accessor, Class::Class or
Class::MethodMaker (those are for methods, which are not important,
but the same technique works for funcitons).  Or even CGI.pm's brand
of autoloading (using strings in a hash instead of the usual
subroutines after __END__).


-- 

Michael G. Schwern   <schwern@pobox.com>    http://www.pobox.com/~schwern/
Plus I remember being impressed with Ada because you could write an
infinite loop without a faked up condition.  The idea being that in Ada
the typical infinite loop would be normally be terminated by detonation.
	-- Larry Wall in <199911192212.OAA23621@kiev.wall.org>

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