did you know that you can store a coderef in @INC?
so, I went to dinner with my friend
jeff so that we can have our semi-regular gripe session about the pains of authorship (he's working on a sysadmin book). anyway, we start talking about
extproc_perl and he mentions that he is trying to solve some performance issues. apparently, the holy grail of extproc_perl is to be able to create indexes in Oracle using perl regular expressions (wow). anyway, apparently, through some coverstations with Tim Bunce, it was suggested that perhaps using the coderef-in-@INC hack might be able to help.
now, I'm not sure what the two of them were talking about, but jeff sent me
this link and I poked around the threads some. now my mind is racing. this is sooooo cool.
seems like, among other things, you could have all pure-perl modules on some website and *poof* no more distribution problems. damn, that's cool. barrie slaymaker mentioned on #axkit the possibility of a CPAN.pm plug-in that installed a library if it couldn't be require()d. ok, so it's a bit crazy, but I'm a firm believer in the "if you build it, they will come" approach to programming.
hmph. wonder if I'll find the time to play with this...
It's Been Done (Score:1)
Re:It's Been Done (Score:1)
thanks for the link. I just can't keep up these days.
Re:It's Been Done (Score:1)
if (PERL_FILE_IS_ABSOLUTE(name)
|| (*name == '.' && (name[1] == '/' ||
(name[1] == '.' && name[2] == '/'))))
{
tryname = name;
tryrsfp = doopen_pmc(name,PERL_SCRIPT_MODE);
}
else {
Now, the code to call the coderef only happens in the else. So if the file is determin
Re:It's Been Done (Score:1)
Another option is to say that URIs obviously aren't absolute in any sense that matters, though that conflates two slightly-different uses of the word. (The Mac behavior you describe seems wrong to me, but I've been known to be
Re:It's Been Done (Score:1)
But I think it would be Wrong to try to special-case URIs; having coderefs in @INC shouldn't be purpose-specific. What if I want to remove all the actual paths in @INC and handle everything via some custom handler? e.g., maybe if it is a Slash module I'll try to get it from my
And if that is the case, if t
Re:It's Been Done (Score:1)
Other uses of coderef in @INC (Score:1)
It's one of those hacks that seems at once utterly fantastic whilst at the same time being totally bloody evil.