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

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

Thread Next
Edward S. Peschko
November 26, 2003 01:07
hooks in @INC of the form &code:function::name
Message ID:
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 and 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,


Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About