CGI.pm problem under Redhat Linux 9.0 (perl-5.8.0)

M

marmot101

Hi,

I just installed Redhat Linux 9.0, which include perl-5.8.0. However, when I
run a perl program begin with:
use CGI /:standard/;

System complains: Can not locate CGI.pm ...

I went to perl directory: /usr/lib/perl5/5.8.0. There is no CGI.pm, but
there is a CGI.pm.newcgi. What should I do? rename this CGI.pm.newcgi to
CGI.pm? that sounds weird ...

Anyone can give me some suggestion?

Thanks!
 
J

James Willmore

use CGI /:standard/;

try:
use CGI qw/:standard/;

Looks like you forgot the qw
I went to perl directory: /usr/lib/perl5/5.8.0. There is no CGI.pm,
but there is a CGI.pm.newcgi. What should I do? rename this
CGI.pm.newcgi to CGI.pm? that sounds weird ...

'.pm' files are going to be located, typically, in your @INC
directories, so you won't see it in the place you were looking. But,
if you REALLY want to find the exact location of the file, type:

perldoc -l CGI

HTH

Jim
 
D

Dan Wilga

I would also strongly recommend you use CPAN to upgrade to the latest
version of CGI.pm. The installation that comes with RH 9.0 seems to be
incomplete.

use either:

cpan

or

perl -MCPAN -e shell

and then "install CGI".
 
J

James Willmore

1. However, on Redhat Linux 9.0, I don't find file/directory "@INC",
I even start searching it from
/,
find . -name *@INC* -print
And no result. Funny thing is, I installed another Perl-5.8.0 at
/usr/local, there is still no "@INC"

2. So I copy CGI.pm.newcgi as CGI.pm, now it works fine. But I
really don't think that's the right way -- I can't believe that
Redhat is so stupid that forcing user to make so weird copy.

3. After this copy, perldoc -l CGI shows it at /usr/lib/perl5/5.8.0
-- it gets satisfied now :)

Okay - I see you're a 'newbie' to Perl. I suggest you start reading
the documentation.

@INC is not a file or directory on the filesystem. It's internal to
Perl. It's an array of directories where Perl can find modules that
have been installed, as well as other files needed to run scripts.

perldoc is the command to use to see the Perl documentation. You can
use the man command on Linux, but it's better to use the perldoc
command IMHO. Start with

perldoc perl

This will give a listing of all the other documents you can view to
get information on using Perl.

HTH

Jim
 
A

Akop Pogosian

marmot101 said:
I just installed Redhat Linux 9.0, which include perl-5.8.0. However, when I
run a perl program begin with:
use CGI /:standard/;
System complains: Can not locate CGI.pm ...
I went to perl directory: /usr/lib/perl5/5.8.0. There is no CGI.pm, but
there is a CGI.pm.newcgi. What should I do? rename this CGI.pm.newcgi to
CGI.pm? that sounds weird ...
Anyone can give me some suggestion?

Possibly, RedHat has packaged CGI.pm as a separate rpm package, the
way they already do with other popular perl modules, and this package
has not been installed. Take a look at your install media to see if
there is an rpm package named Perl-CGI or similar.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top