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

I am using a Windows 2000 Server, Perl works great from the command line and works fine for CGI that doesn't try to access a file within it's path, but when I try to use require to access a module that is in the same folder as the .cgi it says it can't find the module in @inc. When I run a small program called testmy.cgi to test my perl file, it can't see any files or directories under the cgi-bin. I have vigorsly reset permissions on the perl.exe, the cgi-bin directory and the .cgi file itself. The script works great from the command line, but not online. The IUSR is set, Everyone is set. Help!? :)

Replies are listed 'Best First'.
Re: Perl can't see Path
by borisz (Canon) on Sep 09, 2004 at 22:07 UTC
    Try to add the full path to your lib folder to the perl @INC array. In your case it seems to be cgi-bin.
    See: lib
    With use lib 'full/path/to/your/lib';
    Boris
Re: Perl can't see Path
by ysth (Canon) on Sep 09, 2004 at 22:22 UTC
    Have your script print out @INC; . is not usually not in @INC under taint mode.
Re: Perl can't see Path
by swaroop.m (Monk) on Sep 10, 2004 at 05:50 UTC
    Pls check the environment variables.Add the perl\bin to the classpath