|There's more than one way to do things|
RFC: feature proposal re code in @INCby blazar (Canon)
|on Jan 26, 2006 at 11:47 UTC||Need Help??|
One 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™ ;-)
Now, 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 $_ (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 $_ could be made not read-only instead.
I understand that there may be inherent risks in doing so, but
1 See e.g.: