So why does it say it can't find the module? I know it's there. The cgi script runs under user www, but the permisions of the module and containing folder are 777.
Double check everything you think you know to be true. I saw a site change hosting companies. Part of the site was mod_php and part was Perl CGI. The new company had mod_php ran as the
apache user and the CGI ran as the hosting customer's user. The CGI could not read the PHP session files so the site broke.
Write a CGI that prints out the uid, euid, gid, and egid. (See
perlvar).
Like
shmem mentioned try to open the file and print the value of
$!. Run
ls -dl on each hard-coded directory in the file's absolute path.
Print the value of
@INC. Use something like (untested):
#!/usr/bin/perl -w
use strict;
use CGI::Carp qw(fatalsToBrowser);
use Data::Dumper;
my $file = "/data/www/mods/foo.pm";
print $< , "\n";
print $> , "\n";
print $( , "\n";
print $) , "\n";
print Dumper(\@INC);
system('/bin/ls -dl /data');
system('/bin/ls -dl /data/www');
system('/bin/ls -dl /data/www/mods');
system('/bin/ls -dl /data/www/mods/foo.pm');
open FH, "<" . $file or die $!;
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.