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

Can't locate config.cgi

by BzBeauty (Sexton)
on Nov 08, 2004 at 20:19 UTC ( #406200=perlquestion: print w/replies, xml ) Need Help??

BzBeauty has asked for the wisdom of the Perl Monks concerning the following question:

Dear monks,

I have a perl script that was working fine, and then for some reason or the other it stopped working. Here's the error I'm getting.

Can't locate config.cgi

And Here's the line of code it's referring to.

require "config.cgi";

This is the configuration file. This file is in the same folder with the perl script.

Any ideas?


Never mind. I put in the entire location for the file and it worked.

Replies are listed 'Best First'.
Re: Can't locate config.cgi
by tachyon (Chancellor) on Nov 08, 2004 at 22:09 UTC

    Alternatively to a permissions issue your perl may not have . (the cwd) in @INC, thus it won't look for config.cgi in the current dir. In which case you want:

    use lib '.'; require 'config.cgi';



Re: Can't locate config.cgi
by larryp (Deacon) on Nov 09, 2004 at 05:42 UTC

    If you're using IIS, this can be confusing. IIS 5 recognizes relative paths, but they're relative to the root of the site, so including './config.cgi' would look for '/config.cgi'.

    IIS 6, on the other hand, recognizes relative paths in the traditional sense, and and would look for './config.cgi' in the current directory.

    Had to deal with this headache myself a little while back. :)


Re: Can't locate config.cgi
by Aighearach on Nov 08, 2004 at 20:23 UTC
    The webserver probably doesn't have read permissions of the file. If it's unix/linux try chmod a+rx config.cgi or (better) set the owner to the webserver user.

    Snazzy tagline here

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://406200]
Approved by atcroft
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2019-11-22 02:30 GMT
Find Nodes?
    Voting Booth?
    Strict and warnings: which comes first?

    Results (107 votes). Check out past polls.