Discussion:
CGI.pm problem under Redhat Linux 9.0 (perl-5.8.0)
(too old to reply)
marmot101
2003-07-23 16:48:29 UTC
Permalink
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!
James Willmore
2003-07-24 05:06:38 UTC
Permalink
Post by marmot101
use CGI /:standard/;
try:
use CGI qw/:standard/;

Looks like you forgot the qw
Post by marmot101
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
Dan Wilga
2003-07-24 14:13:06 UTC
Permalink
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".
--
Dan Wilga dwilga-***@mtholyoke.edu
** Remove the -MUNGE in my address to reply **
Tad McClellan
2003-07-24 13:10:56 UTC
Permalink
Post by marmot101
use CGI /:standard/;
You should always enable warnings when developing Perl code!
--
Tad McClellan SGML consulting
***@augustmail.com Perl programming
Fort Worth, Texas
James Willmore
2003-07-24 16:25:08 UTC
Permalink
I even start searching it from
/,
And no result. Funny thing is, I installed another Perl-5.8.0 at
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
Akop Pogosian
2003-07-28 23:30:57 UTC
Permalink
Post by marmot101
Hi,
I just installed Redhat Linux 9.0, which include perl-5.8.0. However, when I
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.
--
Akop Pogosian

This space has been accidentally left blank.
Loading...