I'm not sure what version (perl, CGI) you're running, but I don't seem to be able to duplicate the problem in either of my two environments:
WinXP:
perl, v5.6.1 built for MSWin32-x86-multi-thread
Binary build 631 provided by ActiveState Tool Corp. Built 17:16:22 Jan
+ 2 2002
$CGI::revision = '$Id: CGI.pm,v 1.49 2001/02/04 23:08:39 lstein Exp $'
+;
$CGI::VERSION='2.752';
Solaris 8:
perl, v5.6.0 built for sun4-solaris
$CGI::revision = '$Id: CGI.pm,v 1.19 1999/08/31 17:04:37 lstein Exp $'
+;
$CGI::VERSION='2.56';
Neither of the boxen had leaks running the following:
use strict;
use CGI;
$|++;
my $ct = 0;
while (1)
{
$ct++;
if (1)
{
my $cgi = new CGI("q=$ct");
my $blah = $cgi->param('q');
print " blah: $blah\n";
}
}
On the PC I let them run for more than 256 seconds (256 MB RAM) and I monitored the Solaris version using top with no visible memory leaks. You might try running my code and see if it leaks as well, but I don't think CGI.pm is the cause.
--Jim