<!DOCTYPE html>
<html class="client-nojs vector-feature-language-in-header-enabled vector-feature-language-in-main-page-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-0 vector-toc-not-available vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-0 skin-theme-clientpref-os vector-sticky-header-enabled" lang="en" dir="ltr"><head>
    <meta charset="UTF-8">
    <title>CGI.pm</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="icon" type="image/png" href="./_res_/favicon.png">
    <link rel="canonical" href="https://en.wikipedia.org/wiki/CGI.pm"> <link href="./_mw_/ext.cite.styles.css" rel="stylesheet" type="text/css">
    <link href="./_mw_/ext.pygments.css" rel="stylesheet" type="text/css">
    <link href="./_mw_/ext.wikimediamessages.styles.css" rel="stylesheet" type="text/css">
    <link href="./_mw_/skins.vector.icons.css" rel="stylesheet" type="text/css">
    <link href="./_mw_/skins.vector.search.codex.styles.css" rel="stylesheet" type="text/css">
    <link href="./_mw_/skins.vector.styles.css" rel="stylesheet" type="text/css">
    <meta name="ResourceLoaderDynamicStyles" content="">
    
    <link rel="stylesheet" type="text/css" href="./_mw_/site.styles.css">
    <link rel="stylesheet" type="text/css" href="./_mw_/noscript.css">
    <link rel="stylesheet" type="text/css" href="./_res_/footer.css">
    <link rel="stylesheet" type="text/css" href="./_res_/vector-2022.css">
  </head>
  <body class="skin--responsive skin-vector skin-vector-search-vue mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-0 ns-subject page-CGI_pm rootpage-CGI_pm skin-vector-2022 action-view">
    <div class="mw-page-container">
      <div class="mw-page-container-inner">
        <div class="mw-content-container">
          <main id="content" class="mw-body">
            <header class="mw-body-header vector-page-titlebar">
              <h1 id="firstHeading" class="firstHeading mw-first-heading"><span class="mw-page-title-main">CGI.pm</span></h1>
            </header>
            <a id="top"></a>
            <div id="bodyContent" class="vector-body ve-init-mw-desktopArticleTarget-targetContainer" aria-labelledby="firstHeading" data-mw-ve-target-container="">
              <div id="contentSub">
                <div id="mw-content-subtitle"></div>
              </div>
              <div id="mw-content-text" class="mw-body-content mw-content-ltr" lang="en" dir="ltr"><div class="mw-content-ltr mw-parser-output" lang="en" dir="ltr">
<style data-mw-deduplicate="TemplateStyles:r1305433154">
/* start https://en.wikipedia.org/ */


.mw-parser-output .ambox{border:1px solid #a2a9b1;border-left:10px solid #36c;background-color:#fbfbfb;box-sizing:border-box}.mw-parser-output .ambox+link+.ambox,.mw-parser-output .ambox+link+style+.ambox,.mw-parser-output .ambox+link+link+.ambox,.mw-parser-output .ambox+.mw-empty-elt+link+.ambox,.mw-parser-output .ambox+.mw-empty-elt+link+style+.ambox,.mw-parser-output .ambox+.mw-empty-elt+link+link+.ambox{margin-top:-1px}html body.mediawiki .mw-parser-output .ambox.mbox-small-left{margin:4px 1em 4px 0;overflow:hidden;width:238px;border-collapse:collapse;font-size:88%;line-height:1.25em}.mw-parser-output .ambox-speedy{border-left:10px solid #b32424;background-color:#fee7e6}.mw-parser-output .ambox-delete{border-left:10px solid #b32424}.mw-parser-output .ambox-content{border-left:10px solid #f28500}.mw-parser-output .ambox-style{border-left:10px solid #fc3}.mw-parser-output .ambox-move{border-left:10px solid #9932cc}.mw-parser-output .ambox-protection{border-left:10px solid #a2a9b1}.mw-parser-output .ambox .mbox-text{border:none;padding:0.25em 0.5em;width:100%}.mw-parser-output .ambox .mbox-image{border:none;padding:2px 0 2px 0.5em;text-align:center}.mw-parser-output .ambox .mbox-imageright{border:none;padding:2px 0.5em 2px 0;text-align:center}.mw-parser-output .ambox .mbox-empty-cell{border:none;padding:0;width:1px}.mw-parser-output .ambox .mbox-image-div{width:52px}@media(min-width:720px){.mw-parser-output .ambox{margin:0 10%}}@media print{body.ns-0 .mw-parser-output .ambox{display:none!important}}


/* end   https://en.wikipedia.org/ */
</style>

<style data-mw-deduplicate="TemplateStyles:r1316064257">
/* start https://en.wikipedia.org/ */


.mw-parser-output .infobox-subbox{padding:0;border:none;margin:-3px;width:auto;min-width:100%;font-size:100%;clear:none;float:none;background-color:transparent;color:inherit}.mw-parser-output .infobox-3cols-child{margin:-3px}.mw-parser-output .infobox .navbar{font-size:100%}@media screen{html.skin-theme-clientpref-night .mw-parser-output .infobox-full-data:not(.notheme)>div:not(.notheme)[style]{background:#1f1f23!important;color:#f8f9fa}}@media screen and (prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output .infobox-full-data:not(.notheme)>div:not(.notheme)[style]{background:#1f1f23!important;color:#f8f9fa}}@media(min-width:640px){body.skin--responsive .mw-parser-output .infobox-table{display:table!important}body.skin--responsive .mw-parser-output .infobox-table>caption{display:table-caption!important}body.skin--responsive .mw-parser-output .infobox-table>tbody{display:table-row-group}body.skin--responsive .mw-parser-output .infobox-table th,body.skin--responsive .mw-parser-output .infobox-table td{padding-left:inherit;padding-right:inherit}}


/* end   https://en.wikipedia.org/ */
</style><table class="infobox vevent"><tbody><tr><th colspan="2" class="infobox-above summary">CGI.pm</th></tr><tr><th scope="row" class="infobox-label" style="white-space: nowrap;"><a href="Programmer" title="Programmer">Original author</a></th><td class="infobox-data"><a href="Lincoln_Stein" title="Lincoln Stein">Lincoln Stein</a></td></tr><tr><th scope="row" class="infobox-label" style="white-space: nowrap;"><a href="Programmer" title="Programmer">Developer</a></th><td class="infobox-data">Lee Johnson</td></tr><tr style="display: none;"><td colspan="2" class="infobox-full-data"></td></tr><tr><th scope="row" class="infobox-label" style="white-space: nowrap;"><a href="Software_release_life_cycle" title="Software release life cycle">Stable release</a></th><td class="infobox-data"><div style="margin:0px;">4.71
   / 2025-10-01</div></td></tr><tr style="display:none"><td colspan="2">
</td></tr><tr><th scope="row" class="infobox-label" style="white-space: nowrap;"><a href="Computing_platform" title="Computing platform">Platform</a></th><td class="infobox-data"><a href="Perl" title="Perl">Perl</a></td></tr><tr><th scope="row" class="infobox-label" style="white-space: nowrap;"><a href="Software_categories#Categorization_approaches" title="Software categories">Type</a></th><td class="infobox-data"><a href="Perl_module" title="Perl module">Perl module</a> for <a href="Common_Gateway_Interface" title="Common Gateway Interface">CGI</a></td></tr><tr><th scope="row" class="infobox-label" style="white-space: nowrap;"><a href="Software_license" title="Software license">License</a></th><td class="infobox-data"><a href="Artistic_License" title="Artistic License">Artistic License</a></td></tr><tr><th scope="row" class="infobox-label" style="white-space: nowrap;">Website</th><td class="infobox-data"><span class="url"><a rel="nofollow" class="external text" href="https://metacpan.org/release/CGI">metacpan<wbr>.org<wbr>/release<wbr>/CGI</a></span></td></tr></tbody></table> 
<p><b>CGI.pm</b> is a large and once widely used <a href="Perl_module" title="Perl module">Perl module</a> for <a href="Computer_programming" title="Computer programming">programming</a> <a href="Common_Gateway_Interface" title="Common Gateway Interface">Common Gateway Interface</a> (CGI) <a href="WWW" class="mw-redirect" title="WWW">web</a> applications, providing a consistent <a href="Application_programming_interface" class="mw-redirect" title="Application programming interface">API</a> for receiving and processing user input. There are also functions for producing <a href="HTML" title="HTML">HTML</a> or <a href="XHTML" title="XHTML">XHTML</a> output, but these are now unmaintained and are to be avoided.<sup id="cite_ref-auto_1-0" class="reference"><a href="#cite_note-auto-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> CGI.pm was a core Perl module but has been removed as of v5.22 of Perl.<sup id="cite_ref-auto_1-1" class="reference"><a href="#cite_note-auto-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> The module was written by <a href="Lincoln_Stein" title="Lincoln Stein">Lincoln Stein</a> <sup id="cite_ref-2" class="reference"><a href="#cite_note-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup> and is now maintained by Lee Johnson.
</p>

<div class="mw-heading mw-heading2"><h2 id="History">History</h2></div>
<p>In 1993 the CGI specification was formalized to standardize how web servers could execute external programs and scripts; instead of just serving static files, they could generate dynamic content.&nbsp; In response to individual requests, CGI scripts could process user input and generate new HTML pages on the fly.<sup id="cite_ref-:0_3-0" class="reference"><a href="#cite_note-:0-3"><span class="cite-bracket">[</span>3<span class="cite-bracket">]</span></a></sup>
</p><p>CGI.pm was written by <a href="Lincoln_Stein" title="Lincoln Stein">Lincoln Stein</a> to simplify not only the process of correctly capturing information and data sent to a web site, but also generating the new HTML content in the response.
</p><p>Before the advent of this module, creating a CGI script from scratch required writing code that could: 
</p>
<ol><li>Parse environment variables (to get request data)</li>
<li>Decode URL-encoded form data</li>
<li>Parse query strings</li>
<li>Generate proper HTTP headers</li>
<li>Escape HTML output to prevent errors <sup id="cite_ref-:0_3-1" class="reference"><a href="#cite_note-:0-3"><span class="cite-bracket">[</span>3<span class="cite-bracket">]</span></a></sup></li></ol>
<p>In contrast, the various methods and functions available in CGI.pm allowed one to create a Perl script that automated a great deal of the more tedious coding (see examples below).  Many of the largest and most well-known web sites and Web Apps relied on CGI.pm when they were first launched: <a href="EBay" title="EBay">EBay</a>, <a href="IMDb" title="IMDb">IMDb</a>, <a href="CPanel" title="CPanel">CPanel</a>, <a href="Slashdot" title="Slashdot">Slashdot</a>, <a href="Craigslist" title="Craigslist">Craigslist</a>, <a href="Ticketmaster" title="Ticketmaster">Ticketmaster</a>, <a href="Booking.com" title="Booking.com">Booking.com</a>, <a href="TWiki" title="TWiki">TWiki</a>, <a href="Bugzilla" title="Bugzilla">Bugzilla</a>, <a href="Movable_type" title="Movable type">Movable type</a>, and <a href="LiveJournal" title="LiveJournal">LiveJournal</a>. <sup id="cite_ref-4" class="reference"><a href="#cite_note-4"><span class="cite-bracket">[</span>4<span class="cite-bracket">]</span></a></sup>. However, in the interim, as web development toolkits expanded and evolved over time, these sites eventually migrated to using other programming languages and frameworks. <sup id="cite_ref-5" class="reference"><a href="#cite_note-5"><span class="cite-bracket">[</span>5<span class="cite-bracket">]</span></a></sup>,<sup id="cite_ref-6" class="reference"><a href="#cite_note-6"><span class="cite-bracket">[</span>6<span class="cite-bracket">]</span></a></sup>
</p>
<div class="mw-heading mw-heading2"><h2 id="Examples">Examples</h2></div>
<p>Here is a simple CGI page, written in Perl using CGI.pm (in <a href="Object-oriented_programming" title="Object-oriented programming">object-oriented</a> style):
</p>
<div class="mw-highlight mw-highlight-lang-perl mw-content-ltr" dir="ltr"><pre><span></span><span class="ch">#!/usr/bin/env perl</span>

<span class="k">use</span><span class="w"> </span><span class="nn">strict</span><span class="p">;</span>
<span class="k">use</span><span class="w"> </span><span class="nn">warnings</span><span class="p">;</span>

<span class="k">use</span><span class="w"> </span><span class="nn">CGI</span><span class="p">;</span>

<span class="k">my</span><span class="w"> </span><span class="nv">$cgi</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nn">CGI</span><span class="o">-&gt;</span><span class="k">new</span><span class="p">;</span>

<span class="k">print</span><span class="w"> </span><span class="nv">$cgi</span><span class="o">-&gt;</span><span class="n">header</span><span class="p">(</span><span class="s">'text/html'</span><span class="p">);</span>

<span class="k">print</span><span class="w"> </span><span class="o">&lt;&lt;</span><span class="w"> </span><span class="s">"EndOfHTML"</span><span class="p">;</span>
<span class="o">&lt;!</span><span class="n">DOCTYPE</span><span class="w"> </span><span class="n">html</span><span class="o">&gt;</span>
<span class="sr">&lt;html&gt;</span>
<span class="w">    </span><span class="sr">&lt;head&gt;</span>
<span class="w">        </span><span class="sr">&lt;title&gt;</span><span class="n">A</span><span class="w"> </span><span class="n">Simple</span><span class="w"> </span><span class="n">CGI</span><span class="w"> </span><span class="n">Page</span><span class="sr">&lt;/title&gt;</span>
<span class="w">        </span><span class="o">&lt;</span><span class="n">meta</span><span class="w"> </span><span class="n">http</span><span class="o">-</span><span class="n">equiv</span><span class="o">=</span><span class="s">"Content-Type"</span><span class="w"> </span><span class="n">content</span><span class="o">=</span><span class="s">"text/html; charset=iso-8859-1"</span><span class="w"> </span><span class="o">/&gt;</span>
<span class="w">    </span><span class="sr">&lt;/head&gt;</span>
<span class="w">    </span><span class="sr">&lt;body&gt;</span>
<span class="w">        </span><span class="sr">&lt;h1&gt;</span><span class="n">A</span><span class="w"> </span><span class="n">Simple</span><span class="w"> </span><span class="n">CGI</span><span class="w"> </span><span class="n">Page</span><span class="sr">&lt;/h1&gt;</span>
<span class="w">        </span><span class="o">&lt;</span><span class="n">form</span><span class="w"> </span><span class="n">method</span><span class="o">=</span><span class="s">"post"</span><span class="w"> </span><span class="n">enctype</span><span class="o">=</span><span class="s">"multipart/form-data"</span><span class="o">&gt;</span>
<span class="w">            </span><span class="n">Name:</span><span class="w"> </span><span class="o">&lt;</span><span class="n">input</span><span class="w"> </span><span class="n">type</span><span class="o">=</span><span class="s">"text"</span><span class="w"> </span><span class="n">name</span><span class="o">=</span><span class="s">"name"</span><span class="w">  </span><span class="sr">/&gt;&lt;br /</span><span class="o">&gt;</span>
<span class="w">            </span><span class="n">Age:</span><span class="w"> </span><span class="o">&lt;</span><span class="n">input</span><span class="w"> </span><span class="n">type</span><span class="o">=</span><span class="s">"text"</span><span class="w"> </span><span class="n">name</span><span class="o">=</span><span class="s">"age"</span><span class="w">  </span><span class="o">/&gt;</span><span class="sr">&lt;p&gt;</span>
<span class="w">            </span><span class="o">&lt;</span><span class="n">input</span><span class="w"> </span><span class="n">type</span><span class="o">=</span><span class="s">"submit"</span><span class="w"> </span><span class="n">name</span><span class="o">=</span><span class="s">"Submit!"</span><span class="w"> </span><span class="n">value</span><span class="o">=</span><span class="s">"Submit!"</span><span class="w"> </span><span class="o">/&gt;</span>
<span class="w">        </span><span class="sr">&lt;/form&gt;</span>
<span class="w">        </span><span class="o">&lt;</span><span class="n">hr</span><span class="w"> </span><span class="o">/&gt;</span>
<span class="n">EndOfHTML</span>

<span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="w"> </span><span class="k">my</span><span class="w"> </span><span class="nv">$name</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nv">$cgi</span><span class="o">-&gt;</span><span class="n">param</span><span class="p">(</span><span class="s">'name'</span><span class="p">)</span><span class="w"> </span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="w">    </span><span class="k">print</span><span class="w"> </span><span class="s">"Your name is $name.&lt;br /&gt;"</span><span class="p">;</span>
<span class="p">}</span>

<span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="w"> </span><span class="k">my</span><span class="w"> </span><span class="nv">$age</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nv">$cgi</span><span class="o">-&gt;</span><span class="n">param</span><span class="p">(</span><span class="s">'age'</span><span class="p">)</span><span class="w"> </span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="w">    </span><span class="k">print</span><span class="w"> </span><span class="s">"You are $age years old."</span><span class="p">;</span>
<span class="p">}</span>

<span class="k">print</span><span class="w"> </span><span class="s">'&lt;/body&gt;&lt;/html&gt;'</span><span class="p">;</span>
</pre></div>
<p>This would print a very simple webform, asking for your name and age, and after having been submitted, redisplaying the form with the name and age displayed below it.  This sample makes use of CGI.pm's object-oriented abilities; it can also be done by calling functions directly, without the <style data-mw-deduplicate="TemplateStyles:r886049734">
/* start https://en.wikipedia.org/ */


.mw-parser-output .monospaced{font-family:monospace,monospace}


/* end   https://en.wikipedia.org/ */
</style><span class="monospaced">$cgi-&gt;</span>, however the necessary functions must be imported into the namespace of the script that requires access to those functions:
</p>
<div class="mw-highlight mw-highlight-lang-perl mw-content-ltr" dir="ltr"><pre><span></span><span class="ch">#!perl</span>

<span class="k">use</span><span class="w"> </span><span class="nn">strict</span><span class="p">;</span>
<span class="k">use</span><span class="w"> </span><span class="nn">warnings</span><span class="p">;</span>
<span class="k">use</span><span class="w"> </span><span class="nn">CGI</span><span class="w"> </span><span class="sx">qw/ :standard /</span><span class="p">;</span>

<span class="k">print</span><span class="w"> </span><span class="n">header</span><span class="p">(</span><span class="s">'text/html'</span><span class="p">);</span>

<span class="c1"># ... HTML output same as above example</span>

<span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="w"> </span><span class="k">my</span><span class="w"> </span><span class="nv">$name</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">param</span><span class="p">(</span><span class="s">'name'</span><span class="p">)</span><span class="w"> </span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="w">    </span><span class="k">print</span><span class="w"> </span><span class="s">"Your name is $name.&lt;br /&gt;"</span><span class="p">;</span>
<span class="p">}</span>

<span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="w"> </span><span class="k">my</span><span class="w"> </span><span class="nv">$age</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">param</span><span class="p">(</span><span class="s">'age'</span><span class="p">)</span><span class="w"> </span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="w">    </span><span class="k">print</span><span class="w"> </span><span class="s">"You are $age years old."</span><span class="p">;</span>
<span class="p">}</span>

<span class="k">print</span><span class="w"> </span><span class="s">'&lt;/body&gt;&lt;/html&gt;'</span><span class="p">;</span>
</pre></div>
<p>Note: in many examples <var style="padding-right: 1px;">$q</var>, short for query, is used to store a CGI object.
</p>
<div class="mw-heading mw-heading2"><h2 id="See_also">See also</h2></div>
<style data-mw-deduplicate="TemplateStyles:r1266661725">
/* start https://en.wikipedia.org/ */


.mw-parser-output .portalbox{padding:0;margin:0.5em 0;display:table;box-sizing:border-box;max-width:175px;list-style:none}.mw-parser-output .portalborder{border:1px solid var(--border-color-base,#a2a9b1);padding:0.1em;background:var(--background-color-neutral-subtle,#f8f9fa)}.mw-parser-output .portalbox-entry{display:table-row;font-size:85%;line-height:110%;height:1.9em;font-style:italic;font-weight:bold}.mw-parser-output .portalbox-image{display:table-cell;padding:0.2em;vertical-align:middle;text-align:center}.mw-parser-output .portalbox-link{display:table-cell;padding:0.2em 0.2em 0.2em 0.3em;vertical-align:middle}@media(min-width:720px){.mw-parser-output .portalleft{margin:0.5em 1em 0.5em 0}.mw-parser-output .portalright{clear:right;float:right;margin:0.5em 0 0.5em 1em}}


/* end   https://en.wikipedia.org/ */
</style>
<ul><li><a href="Mod_perl" title="Mod perl">mod_perl</a></li></ul>
<div class="mw-heading mw-heading2"><h2 id="References">References</h2></div>
<style data-mw-deduplicate="TemplateStyles:r1327269900">
/* start https://en.wikipedia.org/ */


.mw-parser-output .reflist-columns-2{column-width:30em}.mw-parser-output .reflist-columns-3{column-width:25em}body.skin-vector-2022 .mw-parser-output .reflist-columns-2{column-width:27em}body.skin-vector-2022 .mw-parser-output .reflist-columns-3{column-width:22.5em}.mw-parser-output .references[data-mw-group=upper-alpha]{list-style-type:upper-alpha}.mw-parser-output .references[data-mw-group=upper-roman]{list-style-type:upper-roman}.mw-parser-output .references[data-mw-group=lower-alpha]{list-style-type:lower-alpha}.mw-parser-output .references[data-mw-group=lower-greek]{list-style-type:lower-greek}.mw-parser-output .references[data-mw-group=lower-roman]{list-style-type:lower-roman}.mw-parser-output div.reflist-liststyle-upper-alpha .references{list-style-type:upper-alpha}.mw-parser-output div.reflist-liststyle-upper-roman .references{list-style-type:upper-roman}.mw-parser-output div.reflist-liststyle-lower-alpha .references{list-style-type:lower-alpha}.mw-parser-output div.reflist-liststyle-lower-greek .references{list-style-type:lower-greek}.mw-parser-output div.reflist-liststyle-lower-roman .references{list-style-type:lower-roman}


/* end   https://en.wikipedia.org/ */
</style><div>
<div class="mw-references-wrap"><ol class="references">
<li id="cite_note-auto-1"><span class="mw-cite-backlink">^ <a href="#cite_ref-auto_1-0"><sup><i><b>a</b></i></sup></a> <a href="#cite_ref-auto_1-1"><sup><i><b>b</b></i></sup></a></span> <span class="reference-text"><style data-mw-deduplicate="TemplateStyles:r1333433106">
/* start https://en.wikipedia.org/ */


.mw-parser-output cite.citation{font-style:inherit;word-wrap:break-word}.mw-parser-output .citation q{quotes:"\"""\"""'""'"}.mw-parser-output .citation:target{background-color:rgba(0,127,255,0.133)}.mw-parser-output .id-lock-free.id-lock-free a{background:url("./_mw_/Lock-green.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-limited.id-lock-limited a,.mw-parser-output .id-lock-registration.id-lock-registration a{background:url("./_mw_/Lock-gray-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-subscription.id-lock-subscription a{background:url("./_mw_/Lock-red-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .cs1-ws-icon a{background:url("./_mw_/Wikisource-logo.svg")right 0.1em center/12px no-repeat}body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-free a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-limited a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-registration a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-subscription a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .cs1-ws-icon a{background-size:contain;padding:0 1em 0 0}.mw-parser-output .cs1-code{color:inherit;background:inherit;border:none;padding:inherit}.mw-parser-output .cs1-hidden-error{display:none;color:var(--color-error,#bf3c2c)}.mw-parser-output .cs1-visible-error{color:var(--color-error,#bf3c2c)}.mw-parser-output .cs1-maint{display:none;color:#085;margin-left:0.3em}.mw-parser-output .cs1-kern-left{padding-left:0.2em}.mw-parser-output .cs1-kern-right{padding-right:0.2em}.mw-parser-output .citation .mw-selflink{font-weight:inherit}@media screen{.mw-parser-output .cs1-format{font-size:95%}html.skin-theme-clientpref-night .mw-parser-output .cs1-maint{color:#18911f}}@media screen and (prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output .cs1-maint{color:#18911f}}


/* end   https://en.wikipedia.org/ */
</style><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://metacpan.org/dist/CGI/view/lib/CGI.pod">"CGI - Handle Common Gateway Interface requests and responses - metacpan.org"</a>. <i>metacpan.org</i>.</cite><span title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&amp;rft.genre=unknown&amp;rft.jtitle=metacpan.org&amp;rft.atitle=CGI+-+Handle+Common+Gateway+Interface+requests+and+responses+-+metacpan.org&amp;rft_id=https%3A%2F%2Fmetacpan.org%2Fdist%2FCGI%2Fview%2Flib%2FCGI.pod&amp;rfr_id=info%3Asid%2Fen.wikipedia.org%3ACGI.pm" class="Z3988"></span></span>
</li>
<li id="cite_note-2"><span class="mw-cite-backlink"><b><a href="#cite_ref-2">^</a></b></span> <span class="reference-text"><cite id="CITEREFStein,_Lincoln_D.1998" class="citation book cs1">Stein, Lincoln D. (1998). <a rel="nofollow" class="external text" href="https://archive.org/details/officialguidetop00stei"><i>Official guide to programming with CGI. pm: [the standard for building Web scripts]</i></a>. New York: Wiley. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a>&nbsp;<bdi>978-0-471-24744-9</bdi>.</cite><span title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rft.genre=book&amp;rft.btitle=Official+guide+to+programming+with+CGI.+pm%3A+%5Bthe+standard+for+building+Web+scripts%5D&amp;rft.place=New+York&amp;rft.pub=Wiley&amp;rft.date=1998&amp;rft.isbn=978-0-471-24744-9&amp;rft.au=Stein%2C+Lincoln+D.&amp;rft_id=https%3A%2F%2Farchive.org%2Fdetails%2Fofficialguidetop00stei&amp;rfr_id=info%3Asid%2Fen.wikipedia.org%3ACGI.pm" class="Z3988"></span></span>
</li>
<li id="cite_note-:0-3"><span class="mw-cite-backlink">^ <a href="#cite_ref-:0_3-0"><sup><i><b>a</b></i></sup></a> <a href="#cite_ref-:0_3-1"><sup><i><b>b</b></i></sup></a></span> <span class="reference-text"><cite id="CITEREFCoarRobinson2004" class="citation report cs1">Coar, Ken A. L.; Robinson, David (October 2004). <a rel="nofollow" class="external text" href="https://datatracker.ietf.org/doc/rfc3875/">The Common Gateway Interface (CGI) Version 1.1</a> (Report). Internet Engineering Task Force<span class="reference-accessdate">. Retrieved <span class="nowrap">2025-12-24</span></span>.</cite><span title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rft.genre=report&amp;rft.btitle=The+Common+Gateway+Interface+%28CGI%29+Version+1.1&amp;rft.pub=Internet+Engineering+Task+Force&amp;rft.date=2004-10&amp;rft.aulast=Coar&amp;rft.aufirst=Ken+A.+L.&amp;rft.au=Robinson%2C+David&amp;rft_id=https%3A%2F%2Fdatatracker.ietf.org%2Fdoc%2Frfc3875%2F&amp;rfr_id=info%3Asid%2Fen.wikipedia.org%3ACGI.pm" class="Z3988"></span></span>
</li>
<li id="cite_note-4"><span class="mw-cite-backlink"><b><a href="#cite_ref-4">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://leejo.github.io/2016/02/22/all_software_is_legacy/">"All Software is Legacy"</a>. <i>leejo.github.io</i><span class="reference-accessdate">. Retrieved <span class="nowrap">2025-12-24</span></span>.</cite><span title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&amp;rft.genre=unknown&amp;rft.jtitle=leejo.github.io&amp;rft.atitle=All+Software+is+Legacy&amp;rft_id=https%3A%2F%2Fleejo.github.io%2F2016%2F02%2F22%2Fall_software_is_legacy%2F&amp;rfr_id=info%3Asid%2Fen.wikipedia.org%3ACGI.pm" class="Z3988"></span></span>
</li>
<li id="cite_note-5"><span class="mw-cite-backlink"><b><a href="#cite_ref-5">^</a></b></span> <span class="reference-text"><cite id="CITEREFStevenson" class="citation web cs1">Stevenson, Michael. <a rel="nofollow" class="external text" href="https://opensource.com/life/16/11/perl-and-birth-dynamic-web">"Perl and the birth of the dynamic web | Opensource.com"</a>. <i>opensource.com</i><span class="reference-accessdate">. Retrieved <span class="nowrap">2025-12-24</span></span>.</cite><span title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&amp;rft.genre=unknown&amp;rft.jtitle=opensource.com&amp;rft.atitle=Perl+and+the+birth+of+the+dynamic+web+%7C+Opensource.com&amp;rft.aulast=Stevenson&amp;rft.aufirst=Michael&amp;rft_id=https%3A%2F%2Fopensource.com%2Flife%2F16%2F11%2Fperl-and-birth-dynamic-web&amp;rfr_id=info%3Asid%2Fen.wikipedia.org%3ACGI.pm" class="Z3988"></span></span>
</li>
<li id="cite_note-6"><span class="mw-cite-backlink"><b><a href="#cite_ref-6">^</a></b></span> <span class="reference-text"><cite id="CITEREFStevenson2018" class="citation journal cs1">Stevenson, Michael (2018-10-02). <a rel="nofollow" class="external text" href="https://doi.org/10.1080/24701475.2018.1495810">"Having it both ways: Larry Wall, Perl and the technology and culture of the early web"</a>. <i>Internet Histories</i>. <b>2</b> (<span class="nowrap">3–</span>4): <span class="nowrap">264–</span>280. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://doi.org/10.1080%2F24701475.2018.1495810">10.1080/24701475.2018.1495810</a>. <a href="ISSN_(identifier)" class="mw-redirect" title="ISSN (identifier)">ISSN</a>&nbsp;<a rel="nofollow" class="external text" href="https://search.worldcat.org/issn/2470-1475">2470-1475</a>.</cite><span title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&amp;rft.genre=article&amp;rft.jtitle=Internet+Histories&amp;rft.atitle=Having+it+both+ways%3A+Larry+Wall%2C+Perl+and+the+technology+and+culture+of+the+early+web&amp;rft.volume=2&amp;rft.issue=%3Cspan+class%3D%22nowrap%22%3E3%E2%80%93%3C%2Fspan%3E4&amp;rft.pages=264-280&amp;rft.date=2018-10-02&amp;rft_id=info%3Adoi%2F10.1080%2F24701475.2018.1495810&amp;rft.issn=2470-1475&amp;rft.aulast=Stevenson&amp;rft.aufirst=Michael&amp;rft_id=https%3A%2F%2Fdoi.org%2F10.1080%2F24701475.2018.1495810&amp;rfr_id=info%3Asid%2Fen.wikipedia.org%3ACGI.pm" class="Z3988"></span></span>
</li>
</ol></div></div>
<div class="mw-heading mw-heading2"><h2 id="External_links">External links</h2></div>
<style data-mw-deduplicate="TemplateStyles:r1314755338">
/* start https://en.wikipedia.org/ */


.mw-parser-output .side-box{margin:4px 0;box-sizing:border-box;border:1px solid #aaa;font-size:88%;line-height:1.25em;background-color:var(--background-color-interactive-subtle,#f8f9fa);color:inherit;display:flow-root}.mw-parser-output .infobox .side-box{font-size:100%}.mw-parser-output .side-box-abovebelow,.mw-parser-output .side-box-text{padding:0.25em 0.9em}.mw-parser-output .side-box-image{padding:2px 0 2px 0.9em;text-align:center}.mw-parser-output .side-box-imageright{padding:2px 0.9em 2px 0;text-align:center}@media(min-width:500px){.mw-parser-output .side-box-flex{display:flex;align-items:center}.mw-parser-output .side-box-text{flex:1;min-width:0}}@media(min-width:640px){.mw-parser-output .side-box{width:238px}.mw-parser-output .side-box-right{clear:right;float:right;margin-left:1em}.mw-parser-output .side-box-left{margin-right:1em}}


/* end   https://en.wikipedia.org/ */
</style><style data-mw-deduplicate="TemplateStyles:r1311551236">
/* start https://en.wikipedia.org/ */


@media print{body.ns-0 .mw-parser-output .sistersitebox{display:none!important}}@media screen{html.skin-theme-clientpref-night .mw-parser-output .sistersitebox img[src*="Wiktionary-logo-en-v2.svg"]{filter:invert(1)brightness(55%)contrast(250%)hue-rotate(180deg)}}@media screen and (prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output .sistersitebox img[src*="Wiktionary-logo-en-v2.svg"]{filter:invert(1)brightness(55%)contrast(250%)hue-rotate(180deg)}}


/* end   https://en.wikipedia.org/ */
</style><div class="side-box side-box-right  sistersitebox"><style data-mw-deduplicate="TemplateStyles:r1126788409">
/* start https://en.wikipedia.org/ */


.mw-parser-output .plainlist ol,.mw-parser-output .plainlist ul{line-height:inherit;list-style:none;margin:0;padding:0}.mw-parser-output .plainlist ol li,.mw-parser-output .plainlist ul li{margin-bottom:0}


/* end   https://en.wikipedia.org/ */
</style>
<div class="side-box-flex">
<div class="side-box-image"><span class="noviewer" typeof="mw:File"><img alt="" src="./_assets_/0c70a452f799bfe840676ee341124611/Wikibooks-logo-en-noslogan.svg.png" decoding="async" width="40" height="40" class="mw-file-element" data-file-width="400" data-file-height="400" loading="lazy"></span></div>
<div class="side-box-text plainlist">The Wikibook <i><a href="https://en.wikibooks.org/wiki/Perl_Programming" class="extiw external" title="wikibooks:Perl Programming">Perl Programming</a></i> has a page on the topic of: <i><b><a href="https://en.wikibooks.org/wiki/Perl_Programming/CGI" class="extiw external" title="wikibooks:Perl Programming/CGI">CGI</a></b></i></div></div>
</div>
<ul><li><a rel="nofollow" class="external text" href="https://metacpan.org/module/CGI">CGI.pm</a> – at the <a href="CPAN" title="CPAN">CPAN</a></li></ul>
<p><br>
</p>
<style data-mw-deduplicate="TemplateStyles:r1271159938">
/* start https://en.wikipedia.org/ */


.mw-parser-output .asbox{position:relative;overflow:hidden}.mw-parser-output .asbox table{background:transparent}.mw-parser-output .asbox p{margin:0}.mw-parser-output .asbox p+p{margin-top:0.25em}.mw-parser-output .asbox-body{font-style:italic}.mw-parser-output .asbox-note{font-size:smaller}.mw-parser-output .asbox .navbar{position:absolute;top:-0.75em;right:1em;display:none}.mw-parser-output :not(p):not(.asbox)+style+.asbox,.mw-parser-output :not(p):not(.asbox)+link+.asbox{margin-top:3em}


/* end   https://en.wikipedia.org/ */
</style></div><!--htdig_noindex--><div><div class="zim-footer">
    This article is issued from <a class="external text" title="Last edited on 2025-12-24" href="https://en.wikipedia.org/wiki/?title=CGI.pm&amp;oldid=1329252590">Wikipedia</a>. The text is available under <a class="external text" href="https://creativecommons.org/licenses/by-sa/4.0/deed.en">Creative Commons Attribution-Share Alike 4.0</a> unless otherwise noted. Additional terms may apply for the media files.
</div>
</div><!--/htdig_noindex--></div>
            </div>
          </main>
        </div>
      </div>
    </div>
     <script src="./_webp_/webpHandler.js"></script>
  

</body></html>