<?xml version="1.0" encoding="windows-1252"?>
<node id="77669" title="No excuses about not using CGI.pm" created="2001-05-03 14:57:01" updated="2005-08-15 15:00:50">
<type id="11">
note</type>
<author id="9073">
merlyn</author>
<data>
<field name="doctext">
&lt;blockquote&gt;&lt;i&gt;
Before anyone rips me for not using CGI, I want to let it be known that I am unable to use CGI for this application due to the server I will be using it on.
&lt;/i&gt;&lt;/blockquote&gt;
I don't buy that one.  Sorry.
&lt;p&gt;
If it's a recent usable version of Perl, then CGI.pm came with it.
&lt;p&gt;
Even if it's not, CGI.pm is a single file.  Download it, extract it from the distribution,
and place it in the "current directory", likely the same place as your script,
or add a &lt;tt&gt;use lib...&lt;/tt&gt; directive to point to its location.
&lt;p&gt;
Even if &lt;b&gt;that&lt;/b&gt; option is not available, because they've said "your application must fit in a single file" (a ludicrous requirement, but work with me on this one),
you can edit your single file as follows:
&lt;code&gt;
BEGIN {
... insert contents of CGI.pm here, stopping just before the __END__ token
}
BEGIN {
  CGI-&gt;import(":all");
}
... your code goes here ...
my $foo = param("bar");
... more of your code goes here ...
&lt;/code&gt;
There.  No excuses.  Use CGI.pm.

&lt;p&gt;-- &lt;a href="http://www.stonehenge.com/merlyn/"&gt;Randal L. Schwartz, Perl hacker&lt;/a&gt;&lt;/p&gt;</field>
<field name="root_node">
77580</field>
<field name="parent_node">
77580</field>
</data>
</node>
