· Language track · Verified

The year CGI.pm left core

Removing a module from the standard distribution is a maintenance decision, not a verdict on the code. Here is what actually changed in 2015, and what did not.

Event
Perl 5.22 removes CGI.pm from core
Deprecated in
Perl 5.20
Track
Language
Verification
Sourced

What happened

CGI.pm entered the standard distribution with Perl 5.004 in 1997. For most of the following two decades it was how Perl programs read form parameters, wrote headers and generated HTML. It was deprecated in Perl 5.20 and removed from the core distribution in Perl 5.22. It remained — and remains — installable from CPAN.

That distinction is the whole story. Removed from core does not mean removed. Nothing that worked on 5.20 stopped working; it just needed to be installed rather than assumed.

Why it mattered

Core is a maintenance promise. Every module in the standard distribution has to be built, tested and supported on every platform Perl targets, in every release, indefinitely. That promise is expensive, and it should be spent on things that a language cannot work without.

By 2015 CGI.pm had outlived its execution model. The interface it standardised assumed one process per request and HTML generated by function calls. Both assumptions had been superseded — by PSGI in 2009 and by template systems long before that. Keeping it in core was subsidising an old pattern with the maintenance budget of the language.

What this decision was not It was not a statement that the module was badly written, that CGI as a protocol was invalid, or that anyone running it should panic. Reading it that way is the single most common misinterpretation of the 2015 change, and it is worth naming.

What remains today

A great deal of running code that still says use CGI;. That is not a rhetorical flourish — it is why Script Rescue exists on this site. Code from that era is still deployed, still reachable, and in many cases still maintained by someone who inherited it.

The practical position in 2026: if you are maintaining it, install it from CPAN and leave it alone until you have a reason. If you are writing something new, you are writing a PSGI application, and the question does not arise.

what changed for an existing script · 5.20 → 5.22 diff
# the code:
  use CGI;                     # unchanged

  # 5.20: present in the core distribution
  # 5.22: cpanm CGI   — one install step, same module

Sources

This event is marked verified: an editor checked the release dates against the source above. The interpretation in “Why it mattered” is editorial and is labelled as such.

Public correction trail Prefer a public record? Open a sourced issue in the PerlCoders repository.