develooper Front page | perl.perl5.porters | Postings from February 2004

Re: Recursive call to Perl_load_module in PerlIO_find_layer

Thread Previous | Thread Next
From:
Stas Bekman
Date:
February 21, 2004 04:51
Subject:
Re: Recursive call to Perl_load_module in PerlIO_find_layer
Message ID:
403725F9.20801@stason.org
Elizabeth Mattijsen wrote:
> At 21:33 +0100 1/25/04, Rafael Garcia-Suarez wrote:
> 
>> Elizabeth Mattijsen wrote:
>>  > dies with the error:
>>  >   Recursive call to Perl_load_module in PerlIO_find_layer line 3.
>>
>>>    BEGIN failed--compilation aborted line 6.
>>
>>  >   BEGIN failed--compilation aborted line 6.
>> Because it tries to load PerlIO::Scalar while trying to load
>> PerlIO::Scalar.
> 
> 
> Indeed.  This works like a charm:
> 
> BEGIN {
>     require PerlIO::Scalar;
>     unshift( @INC,sub {
>         my $data; open( my $in,'<',\$data );
>     } );
> }
> use Foo;
> 
> But I would never have gotten from the error message to this fix.
> 
> But this implies that PerlIO::Scalar is only loaded the first time you 
> try to do an open() like that.  Are there many more situations like that 
> in Perl nowadays?  Is there a list of this modules that get 
> automatically loaded on demand?  Could be important for optimizing Perl 
> on mod_perl prefork MPMs...

Liz,

Module::Use will tell you about all modules that get loaded behind the scenes:
http://search.cpan.org/dist/Module-Use/
Load it the very last thing in httpd.conf.

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

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