in reply to CGI.pm on AIX 7.2

Are you asking if your code will work with the newest version of CGI? Probably. You could always install the version you used on the older box, but I'd try the latest version first.

Replies are listed 'Best First'.
Re^2: CGI.pm on AIX 7.2
by Anonymous Monk on Aug 01, 2023 at 16:54 UTC
    Hi,

    I'm having the following error on apache log when i tried to run the command use CGI on my .cgi script:

    ####Script .cgi ##### #!/usr/bin/perl use CGI; use lib qw(../cgi-lib); use POSIX qw(strftime); use siteconfig; use parseFile; use libUtil; use strict; ########
    ###Log Apache [Tue Aug 1 12:39:01 2023] [notice] Apache/1.3.9 (Unix) configured -- +resuming normal operations Can't locate object method "new" via package "CGI" (perhaps you forgot + to load "CGI"?) at /usr/opt/perl5/lib/site_perl/5.28.1/CGI.pm line 7 +. Compilation failed in require at /ieweb/webmon61/cgi-bin/procStatus.cg +i line 3. BEGIN failed--compilation aborted at /ieweb/webmon61/cgi-bin/procStatu +s.cgi line 3
    Thank you

      This looks like a broken, or at least inconsistent installation.

      Examine the file /usr/opt/perl5/lib/site_perl/5.28.1/CGI.pm: Your code seems to assume that this is the library CGI, but this library definitely does not call CGI->new.

      Perhaps you can track down where this CGI.pm comes from, and how /usr/opt/perl5/lib/site_perl/5.28.1/ ended up in your @INC directory. Or you could try installing CGI.pm with the package manager of your distribution, or from CPAN, and make sure that this version is used instead of your weird one.

      Also, cgi-lib seems to be something from a very distant past.... where did that script come from? Perl 4?

      Something's really wrong with /usr/opt/perl5/lib/site_perl/5.28.1/CGI.pm.