see this:
https://metacpan.org/pod/distribution/CGI/lib/CGI.pod#CGI.pm-HAS-BEEN-REMOVED-FROM-THE-PERL-CORE If you upgrade to a new version of perl or if you rely on a system or vendor perl and get an updated version of perl through a system update, then you will have to install CGI.pm yourself with cpan/cpanm/a vendor package/manually.
(i would suggest reading the entire section)
CGI.pm doesn't have to be replaced to keep your application working, it just needs to be a separately installed module once perl has been upgraded by your host (to or beyond 5.22, see below).
therefore i wouldn't necessarily recommend replacing CGI.pm on an existing application.
this is some CPAN documentation on
CGI alternatives [metacpan.org]
this (the removal of CGI.pm from the perl core) has been discussed in the perl programming lists since 2013:
[
nntp.perl.org...]
I think it's time to seriously consider removing CGI.pm from the core distribution. It is no longer what I'd point *anyone* at for writing *any* sort of web code. It is in the core, as far as I know, because once it was the state of the art, and a major reason for many people to use the language. I don't think either is true now.
ouch! (the truth hurts...)
CGI.pm was removed from the perl core in perl 5.22:
https
://perldoc.perl.org/perl5220delta#Removed-Modules-and-Pragmata
perl 5.22 was released june 1, 2015:
[
nntp.perl.org...]