in reply to cgi script can't load my module

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 $!;