Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Restricting @INC for specific application need

by naikonta (Curate)
on Mar 04, 2008 at 02:06 UTC ( #671761=perlmeditation: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    BEGIN { @INC = () }
    
  2. or download this
    BEGIN {
        @INC = qw(
            /path/to/apps/lib
        );
    }
    
  3. or download this
    $ perl -le 'print for @INC'
    /etc/perl
    ...
    /usr/share/perl/5.8
    /usr/local/lib/site_perl
    .
    
  4. or download this
    $ /opt/bin/perl -E 'say for @INC'
    /opt/lib/perl5/5.10.0/i686-linux
    ...
    /opt/lib/perl5/site_perl/5.10.0/i686-linux
    /opt/lib/perl5/site_perl/5.10.0
    .
    
  5. or download this
    $ perl -Mstrict -le 'print $INC{q(strict.pm)}'
    /usr/share/perl/5.8/strict.pm
    
  6. or download this
    $ perl -MFile::Find -le '
    find {
    ...
    '
    /usr/lib/perl/5.8/Data/Dumper.pm
    /usr/share/perl/5.8/strict.pm
    
  7. or download this
    $ ls -ld /usr/lib/perl/5.8 /usr/share/perl/5.8
    lrwxrwxrwx 1 root root 5 2008-02-05 13:17 /usr/lib/perl/5.8 -> 5.8.8
    lrwxrwxrwx 1 root root 5 2008-02-05 13:17 /usr/share/perl/5.8 -> 5.8.8
    
  8. or download this
    BEGIN {
        @INC = qw(
    ...
            /usr/lib/perl/5.8
        );
    }
    
  9. or download this
    $ ./inc.pl
    Can't locate DBI.pm in @INC (@INC contains: /path/to/apps/lib /usr/sha
    +re/perl/5.8 /usr/lib/perl/5.8) at ./inc.pl line 21.
    BEGIN failed--compilation aborted at ./inc.pl line 21.
    
  10. or download this
    $ cat inc.pl
    #!/usr/bin/perl
    ...
    use HTML::Template;
    use URI;
    use Data::Pageset;
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlmeditation [id://671761]
Approved by kyle
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (7)
As of 2014-07-31 07:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (245 votes), past polls