perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Peters <mpet...@plusthree.com>
Subject Re: CGI.pm param and mod_perl
Date Fri, 13 Jun 2008 18:53:37 GMT
Brian Gaber wrote:
>  One thought, my code is written to use the CGI.pm
> default object so that I do not have something like $q = new CGI;  Could
> this be the cuase?

Very well could be.

Doing a "$q = new CGI" means that you will get a new CGI object on every
request, which is what you want. I've never used the function interface of
CGI.pm like you did in your example so I don't know how CGI.pm handles it behind
the scenes (whether it creates a new object on each request or not). But if I
were you, that's probably the first place I'd look.

Also, just a couple of minor nits to help you out. Instead of "$q = new CGI" do
"my $q = CGI->new()". First off the "my" means it's a local (lexical) variable.
Always good to have your vars be local unless you know you'll need something
else. And "new CGI" is the indirect object syntax for method calls which is
generally frowned upon since it can lead to problems that are hard to track
down. "CGI->new()" is alway unambiguous.

-- 
Michael Peters
Plus Three, LP


Mime
View raw message