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

hooks in @INC of the form &code:function::name

Thread Next
From:
Edward S. Peschko
Date:
November 26, 2003 01:07
Subject:
hooks in @INC of the form &code:function::name
Message ID:
20031126021521.GB17800@mdssdev05.comp.pge.com
I'd like to make perl be able to handle syntax like:

@INC = ( '&code:function::name', 'lib', 'lib2' );

which would work the same as 

@INC = ( sub { }, 'lib', 'lib2' );

except be more robust in being able to be evaluated (again, this is hurting in 
PAR, which uses code refs in @INC and hence doesn't handle AutoLoader.pm and 
Inline.pm very well - both of which use eval "use something" or require "something",
which stringifies @INC and hence breaks any code refs in it). 


Anyways, I was trying to hunt down the patch that Ken Fox made on this (back in 
1999) and can't find it via google.  Is it available in the perl archives somewhere? 
If not, is there a good pointer into the code where it is available?

Otherwise, is there an easy fix for making @INC = (sub { }, ...) work even in 
evaluated strings? My gut feel says no (that this would require a good mechanism 
for stringifying and un-stringifying code references), but what do I know.

Thanks much,

Ed

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