in reply to CGI parameter of 0 behaving strangely
Because when delete=0, then param('delete') returns 0. When evaluated in boolean context (which is what if does), 0 is false and all other values are true.
I think what you want is if(defined param('delete')) { . . . }. defined() returns true if the value given is actually defined, but doesn't care what it was defined as.
----
I wanted to explore how Perl's closures can be manipulated, and ended up creating an object system by accident.
-- Schemer
Note: All code is untested, unless otherwise stated
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: CGI parameter of 0 behaving strangely
by Ming (Acolyte) on Jun 12, 2003 at 16:15 UTC |