in reply to Re: Re: CGI or DBI 'cache' problem
in thread CGI or DBI 'cache' problem
Ok... to handle the problem chromatic and I pointed out do this.
queryresult($s_off_no);This is good you loaded the $s_off_no variable into the @_ array
Here is the problem
my $s_off_no = $s_off_no;^ Here you do not touch the var you loaded into @_. You just take the (lexical scoped to the main package) $s_off_no and assign it to (lexical scoped to the sub) $s_off_no (You hope)
What you should really be doing is
my ($s_off_no) = @_;This insures there is no ambiguity to where the the var is coming from. Honestly, I do not know if the perl interepets the RHS as the sub scoped lexical of your statement because I have never done this, but it not only introduces ambiguity to you code (possible problems for the interpreter) it also makes it difficult to read for other people (including youself in a month).
PS: as a side node you are loading all the CGI functions into you main namespace.
use CGI ':standard';But you use the OO interface
my $q = new CGI;you should be able the ditch the ':standard' on the use CGI;
| Unix - where you can throw the manual on the keyboard and get a command |
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: CGI or DBI 'cache' problem
by slok (Acolyte) on May 13, 2002 at 06:09 UTC | |
by grep (Monsignor) on May 13, 2002 at 07:01 UTC |