(A solution would be to force all "my" varialbes at the file scope to be "our" and then put the cgi in an anonymous package:)
On Thu, Feb 12, 2009 at 10:33 AM, Erik Aronesty <earone...@gmail.com> wrote: > -------------8<---------- Start Bug Report ------------8<---------- > 1. Problem Description: > > It's well known that file-scoped lexicals don't work intuitively in > CGI programs under mod_perl. > > When mod_perl calls the same CGI program twice, file-scoped lexicals > are not rebound. > > Some people are aware of this, random posts to newsgroups will attest, > but this is not documented well enough. > > Create a CGI as below, and run it many times, assigning different > CGI::param('foo') values to $x. > Lowering the number of children spawned in Apache will reduce the > number of times needed > to run the script in order to see the problem. > > # this program sometimes prints old values for foo, but only under mod_perl! > > use CGI; > my $x =CGI::param('foo');