http://www.perlmonks.org?node_id=671924


in reply to Restricting @INC for specific application need

I'm still trying to figure this out. It seems it runs contrary to some of the culture of perl. For about the same reason why there are no "private" methods (well, unless you do something really silly), or any way to prevent someone from subclassing your package, the ability to go and install new modules is generally a good thing. In fact, in my setup script, I only expand CPAN modules that haven't been superseded by whatever is on the system already - allowing for a newer module is probably a good thing.

That said, you may be more interested in the only module. It may get you what you want without all the hackery of @INC. (Well, it will do its own hackery, rather than relying on your own hackery :-))