Syntactic Confectionery Delight | |
PerlMonks |
RFC: feature proposal re code in @INCby blazar (Canon) |
on Jan 26, 2006 at 11:47 UTC ( [id://525698]=perlmeditation: print w/replies, xml ) | Need Help?? |
PremiseOne of my favourite 'tricks'1 is the possibility of putting code in @INC, as explained in perldoc -f require. Now, the standard way to use it is to return an open filehandle to the wanted module, e.g.
(Although in this form looks more like obfuscation than a Good Thing™ ;-) The proposalNow, it occurred to me that even if, as usual, there are many other ways to do what I'm about to propose, one may want to use this feature to "alias" a package (or better, a set of packages at a time) by modifying $_[1] (in the case of the sub or array form of this 'trick') - and returning undef to let the default mechanism continue the search in the standard locations. But this is not currently possible:
So I wonder if $_[1] could be made not read-only instead. I understand that there may be inherent risks in doing so, but
1 See e.g.:
Back to
Meditations
|
|