Re: CGI .. its out to get me ...

2001-04-01 Thread rob

Robin Szemeti wrote:
OK girls .. 
...
[submit form with parameter init_login='Login'

my($q)=CGI-new;
...
if ( defined($q-param('init_login')) ){ 
  #do someting and it happens
}
... some code goes by
if ( defined($q-param('init_login')) ){ 
  #do someting and it DOESNT happen
}

now .. you are all about to say .. ahh .. something is reseting the
parameter elsewhere ... either Delete('init_login') or some such BUT if I
swap the first test to be 

First question - is the second if statement in a separate block?
Second question - is your server using mod_perl?

If the answer to both those questions is yes, then mod_perl is doing something nasty 
with closures and your blocks/subs.

Try passing $q around as a parameter - that usually solves the problem.

Alternatively, if you don't mind using the standard interface, then use that.


Rob Thompson



Re: CGI .. its out to get me ...

2001-04-01 Thread Robin Szemeti

On Sun, 01 Apr 2001, you wrote:

 First question - is the second if statement in a separate block?
 Second question - is your server using mod_perl?

nope ... not yet, but thats the intention.

 If the answer to both those questions is yes, then mod_perl is doing something nasty 
with closures and your blocks/subs.
 
 Try passing $q around as a parameter - that usually solves the problem.
 
 Alternatively, if you don't mind using the standard interface, then use that.


indeed $q is passed about as a parameter .. its the same 'q' thats handed
about.

its weird how just not doing the 'if defined' test on it directly makes
that happen ..  if you have more than one value assigned to a parameter
does it return the next on on the list when you call it next time?

hmm .. more investigation needed :) .. just remebered data::dumper is my
freind .. 

-- 
Robin Szemeti

The box said "requires windows 95 or better"
So I installed Linux!