Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Require a script not found in @INC array

by dragonchild (Archbishop)
on Oct 07, 2004 at 03:39 UTC ( #397218=note: print w/replies, xml ) Need Help??


in reply to Require a script not found in @INC array

The problem is that @INC contains directory names. These directory names, if they're relative paths, are relative to the directory within which the webserver is started in. Usually, this is something like /var/www or something like that. You don't normally have a problem when testing your scripts from the commandline because you're usually in the directory the scripts are in. To test this out, go to another directory and try to run your scripts. :-)

You need to add the following line above your requires: use lib qw( /path/to/your/cgi-bin ); and that will fix everything.

Being right, does not endow the right to be rude; politeness costs nothing.
Being unknowing, is not the same as being stupid.
Expressing a contrary opinion, whether to the individual or the group, is more often a sign of deeper thought than of cantankerous belligerence.
Do not mistake your goals as the only goals; your opinion as the only opinion; your confidence as correctness. Saying you know better is not the same as explaining you know better.

Replies are listed 'Best First'.
Re^2: Require a script not found in @INC array
by Anonymous Monk on Oct 07, 2004 at 07:58 UTC
    I added :

    use lib qw(/webroot/d/e/depri001/cgi-bin);

    but it still doesn't work. Here's what AdminPro says now:

    Can't locate config.cgi in @INC (@INC contains: /webroot/d/e/depri001/cgi-bin /etc/perl /usr/lib/perl5/site_perl/5.8.4/i686-linux /usr/lib/perl5/site_perl/5.8.4 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.4/i686-linux /usr/lib/perl5/vendor_perl/5.8.4 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.4/i686-linux /usr/lib/perl5/5.8.4 /usr/local/lib/site_perl .) line 14.

    The cgi-bin path appears in the @INC but it still isn't finding the config.cgi. Thanks for the try.

      Are you absolutely sure you added what 'pwd' says your directory is?

      Also, have you tried my other suggestion of running the script from somewhere other than your cgi-bin? Like, your home directory.

      Being right, does not endow the right to be rude; politeness costs nothing.
      Being unknowing, is not the same as being stupid.
      Expressing a contrary opinion, whether to the individual or the group, is more often a sign of deeper thought than of cantankerous belligerence.
      Do not mistake your goals as the only goals; your opinion as the only opinion; your confidence as correctness. Saying you know better is not the same as explaining you know better.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (7)
As of 2020-12-02 19:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How often do you use taint mode?





    Results (44 votes). Check out past polls.

    Notices?