0
votes

I am using archive extract library in PERL program residing in my apache_tomcat/cgi-bin folder

use Archive::Extract;
    ### build an Archive::Extract object ###
    my $ae=Archive::Extract->new(archive=>$zipFile);
    $ae.extract;

Whenever i run the program i get error

Can't locate Archive/Extract.pm in @INC (@INC contains: /usr/tik/perl/5.8.3/lib/5.8.3/sun4-solaris /usr/tik/perl/5.8.3/lib/5.8.3 /usr/tik/perl/5.8.3/lib/site_perl/5.8.3/sun4-solaris /usr/tik/perl/5.8.3/lib/site_perl/5.8.3 /usr/tik/perl/5.8.3/lib/site_perl .) at /home/scf-17/myname/apache_1.3.26/cgi-bin/mvdb.pl line 74.

I have been researching about it and found i am missing that perl module. i tried install using cpan as root:

cpan -i Archive::Extract

Also i tried YUM but none of it worked.

I am connected to my server using putty... can you suggest other way to install perl module missing?

2
How is CPAN failing? What yum command did you try? How did it fail? - Alien Life Form
cpan : command not found - typedef1

2 Answers

2
votes

Call Tomcat's Perl's cpan, not the system cpan.

/usr/tik/perl/5.8.3/bin/cpan Archive::Extract
0
votes

You need to make sure the perl/cpan that your apache tomcat server is using is the same as the one you're using on the command line. You can also check where the module is installed by typing (in the terminal):

perldoc -l Archive::Extract

This shoudl show you something like:

/usr/local/share/perl/5.10.1/Archive/Extract.pm

And if this path '/usr/local/share/perl/5.10.1' (without the Module name) doesn't exist in your @INC above, then you will need to add it to you script by adding something like this before your 'use Archive::Extract' line:

use lib '/usr/local/share/perl/5.10.1';
use Archive::Extract;

This should do the trick.