Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: require fails in CGI

by sri (Vicar)
on Oct 10, 2003 at 18:03 UTC ( [id://298358]=note: print w/replies, xml ) Need Help??


in reply to require fails in CGI

Just use absolute pathes in your script!
I don't think that your webserver runs from your cgi-bin. ;]

Replies are listed 'Best First'.
Re: Re: require fails in CGI
by heezy (Monk) on Oct 10, 2003 at 18:31 UTC

    you're right it doesn't use a cgi-bin

    Wow! and you were right about the other thing as well. If I put the entire path to the script in the require it works a treat. Thanks!! :)

    require 'c:\s1ws\WebServer6.1\docs\vcol-manager\vcol-utils.pl';

    Why?

    -M

      Because Perl looks in several directories to require or use files. The current working directory is always included in the list. When you tested your CGI script from the command line you cd'd to the directory and then ran it, so it worked. Your web server does not do this - it runs the script without changing its working directory to the CGI directory.

      You could also have solved the problem with:

      use lib 'c:\s1ws\WebServer6.1\docs\vcol-manager'; require 'vcol-utils.pl';
        The current working directory is always included in the list.
        Not always, observe
        E:\>perl -T -le"print for @INC" C:/Perl/lib C:/Perl/site/lib E:\>perl -le"print for @INC" C:/Perl/lib C:/Perl/site/lib . E:\>

        MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
        I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
        ** The third rule of perl club is a statement of fact: pod is sexy.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (3)
As of 2024-03-28 13:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found