Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Restricting @INC for specific application need

by ig (Vicar)
on Mar 27, 2009 at 06:28 UTC ( #753582=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl
    #
    ...
        local @INC = ( "/opt/app/lib" );
        eval "use Application::Module";
    }
    
  2. or download this
    #!/usr/bin/perl
    #
    ...
    use File::Find;
    substr($INC{'File/Find.pm'},0,length(APPLIB)) eq APPLIB
        or die "File::Find incorrectly loaded from " . $INC{'File/Find.pm'
    +};