htmanning has asked for the wisdom of the Perl Monks concerning the following question:

Monks, Our server was upgraded yesterday and a new version of Perl (5.30) was installed. We previously had 5.22. We were calling Ajax like this:
use CGI::Ajax;
After the upgrade we received this error:
Can't locate CGI/ in @INC (you may need to install the CGI::Aja +x module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/p +erl/5.30.0 /usr/local/share/perl/5.30.0 /usr/lib/x86_64-linux-gnu/per +l5/5.30 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.30 /usr/sha +re/perl/5.30 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl- +base) at line 31.
It seems like Ajax is not a default module in 5.30 so it was not automatically installed, but the server company installed the Ajax module for us. The site was still broken so they reverted the server back to 5.22 until we can resolve this. Is there a big difference in Ajax in the new version of Perl or could something else be at issue? I know that's a vague question but when the server gurus couldn't figure it out it left us at a loss. Thanks!

Replies are listed 'Best First'.
Re: Calling Ajax
by Corion (Patriarch) on Apr 21, 2021 at 06:57 UTC

    CGI::Ajax was never included in the Perl core:

    $ corelist CGI::Ajax Data for 2020-12-20 CGI::Ajax was not in CORE (or so I think)

    Most likely you will need to have the Server Company install that module for you, and then check the next module that is missing.

Re: Calling Ajax
by talexb (Chancellor) on Apr 21, 2021 at 13:59 UTC

    Is it possible for you to install this module on your own account? Then you could just add your account's path to a use lib statement, and your script should compile. However, you may find that once you have CGI::Ajax installed, there may be additional dependencies that are also required.

    Alex / talexb / Toronto

    Thanks PJ. We owe you so much. Groklaw -- RIP -- 2003 to 2013.

      However, you may find that once you have CGI::Ajax installed, there may be additional dependencies that are also required.

      Note that all modules that are XS based will have to be recompiled to work against a new version of perl (if I'm not mistaken), so just having them in place will likely not be enough to prevent breakage.

      OP should have a development environment that mirrors the production system in order to ensure a smooth and non-impactful upgrade. It would also be very wise to run under Perlbrew or an otherwise alternate perl instead of using the system perl.

Re: Calling Ajax
by Anonymous Monk on Apr 21, 2021 at 23:38 UTC
    It never was a default module. Exactly how did they "install the Ajax module for you?" Did this error-message appear before or after they did that? (Or both?) Looks like they didn't do it right.
      The error message showed up after they upgraded to Ubuntu 20 and Perl 5.30. When I informed them of the error they said they installed the Ajax module but I still got the same message. Unfortunately, I don't know exactly what they did. They are offering me an option to upgrade to Ubuntu 18.04 until 2023 and they will keep Perl 5.22 installed in an alternate location but Perl 5.30 will be the default.

        This seems unnecessarily convoluted for a workaround to what on the surface seems like a fairly run of the mill problem. Do you have shell access as part of your hosting?