• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2505
  • Last Modified:

Perl CGI script Can't reach Validate.pm

When running a Perl script which uses libraries for Spreadsheet-ParseExcel this error stops completion.

Can't locate Params/Validate.pm in @INC (@INC contains: /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi /usr/lib64/perl5/site_perl/5.8.7/x86_64-linux-thread-multi /usr/lib64/perl5/site_perl/5.8.6/x86_64-linux-thread-multi /usr/lib64/perl5/site_perl/5.8.5/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl/5.8.7 /usr/lib/perl5/site_perl/5.8.6 /usr/lib/perl5/site_perl/5.8.5 /usr/lib/perl5/site_perl /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi /usr/lib64/perl5/vendor_perl/5.8.7/x86_64-linux-thread-multi /usr/lib64/perl5/vendor_perl/5.8.6/x86_64-linux-thread-multi /usr/lib64/perl5/vendor_perl/5.8.5/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl/5.8.7 /usr/lib/perl5/vendor_perl/5.8.6 /usr/lib/perl5/vendor_perl/5.8.5 /usr/lib/perl5/vendor_perl /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/5.8.8 .) at /usr/lib/perl5/5.8.8/Class/MethodMaker.pm line 9.
Compilation failed in require at /usr/lib/perl5/site_perl/5.8.7/GnuPG/Options.pm line 59.
BEGIN failed--compilation aborted at /usr/lib/perl5/site_perl/5.8.7/GnuPG/Options.pm line 59.
Compilation failed in require at /usr/lib/perl5/site_perl/5.8.7/GnuPG/Interface.pm line 28.
BEGIN failed--compilation aborted at /usr/lib/perl5/site_perl/5.8.7/GnuPG/Interface.pm line 28.
Compilation failed in require at /var/www/cgi-bin/EpsilonEOD line 13.
BEGIN failed--compilation aborted at /var/www/cgi-bin/EpsilonEOD line 13.

Yet I find two versions on Validate.pm in the Perl libraries path.

-rw-r--r-- 1 root root 4154 Jan 21  2006 /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/Attribute/Params/Validate.pm
-rw-r--r-- 1 root root 21904 Mar  7  2007 /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/Params/Validate.pm

The closet the path comes is at /usr/lib/perl5/vendor_perl/5.8.8

How can the search be made to include /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/Params

use strict;
use warnings;
use CGI;
use CGI::Carp qw(fatalsToBrowser);
use Spreadsheet::ParseExcel;
use File::Temp;
use IO::Handle;
use GnuPG::Interface;
/var/www/cgi-bin/EpsilonEOD line 13 is "use GnuPG::Interface;"

Open in new window

3 Solutions
Kim RyanIT ConsultantCommented:
It could be the permisions are worng for Validate.pm, it needs execution  bits set. Try
chmod 775 Validate.pm so you get  rwxrwxr-x
use lib '/usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/Params';
imagitastechAuthor Commented:
I tried both setting execute permission to Validate.pm and it didn't resolved the problem.

How do you modify @INC  to include '/usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/Params' ?

Obviously I'm a newbie using Perl but it seems to me there may be a version mismatch with


line 9 is

use Params::Validate qw(validate_pos);
>>How do you modify @INC  to include '/usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/Params' ?
You use the statement ozo gave.  Add it to your main program after your "use warnings" line.
imagitastechAuthor Commented:
I'm a newbie; the answer was concise but I need a bit more detail.

The actual line that worked did not include the '/Params'

use lib '/usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi';

Thanks to everyone for their help.

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now