Patrick Galbraith wrote:
[...]
Hi.
Less nice, less neat, less classic, terrible style, whatever you want,
but which also works :
# my nifty cgi-bin
use strict;
use warnings;
{
package MyOwn;
no strict;
$CGI = '';
}
sub sub1 {
$MyOwn::CGI = new CGI();
}
sub sub2 {
my $name = $MyOwn::CGI->param('name');
}
I am not quite sure why it works, and I would appreciate if some
mod_perl guru could explain it. But it seems to, for years now. Each
invocation of the cgi-bin seems to get its own private copy, without
mixups nor warnings.
But maybe it's not thread-safe and I'm just very lucky ?