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

Discussion in 'Perl Misc' started by marmot101, Jul 23, 2003.

  1. marmot101

    marmot101 Guest

    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!
     
    marmot101, Jul 23, 2003
    #1
    1. Advertising

  2. > 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
     
    James Willmore, Jul 24, 2003
    #2
    1. Advertising

  3. marmot101 <> wrote:

    > use CGI /:standard/;



    You should always enable warnings when developing Perl code!


    --
    Tad McClellan SGML consulting
    Perl programming
    Fort Worth, Texas
     
    Tad McClellan, Jul 24, 2003
    #3
  4. marmot101

    Dan Wilga Guest

    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
    ** Remove the -MUNGE in my address to reply **
     
    Dan Wilga, Jul 24, 2003
    #4

  5. > 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
     
    James Willmore, Jul 24, 2003
    #5
  6. marmot101 <> wrote:
    > 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?


    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.
     
    Akop Pogosian, Jul 29, 2003
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Private
    Replies:
    2
    Views:
    515
    Michael Borgwardt
    Dec 11, 2004
  2. U. George
    Replies:
    4
    Views:
    882
    U. George
    Aug 11, 2005
  3. Tom Williams
    Replies:
    0
    Views:
    267
    Tom Williams
    Jul 22, 2004
  4. RC
    Replies:
    2
    Views:
    133
  5. kath
    Replies:
    4
    Views:
    807
    J. Gleixner
    Apr 9, 2007
Loading...

Share This Page