in reply to check for undefined param name
a null '' is actually undef, it equals to false, so
would work, butunless ($query->param('loc')) { # print error mesage or whatever. }
if ($query->param('loc) eq '') { ... }
does not work...
you might want to take a look at What is truth? here at the monastery for an explanation of "truth" in perl, as there are many 'gotchas' in handling truth in perl ;) (for example, in the code above, if 0 was a valid value for the loc parameter, the code would print the error message, even if we didn't want that.)
hope this helps,
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: check for undefined param name
by tadman (Prior) on Apr 02, 2002 at 23:12 UTC |