Keep It Simple, Stupid | |
PerlMonks |
Odd (literally) problems with HTML::Template and paramsby legLess (Hermit) |
on Jul 10, 2001 at 06:00 UTC ( [id://95221]=perlquestion: print w/replies, xml ) | Need Help?? |
legLess has asked for the wisdom of the Perl Monks concerning the following question:
Monks ~
I'm writing a script with CGI and HTML::Template. This code: Produces an error ("You gave me an odd number of parameters to param()!") if $q->param('realname') isn't defined. Set $q->param('realname') to 0 (or anything else) and everything's fine.
First question Produces no errors with identical input. Why? As long as MEMBER_NAME is the only parameter, it seems not to matter if $q->param('realname') defined or not. It's only when there are other parameters that I get the error. The error itself makes a sort of sense, but this seems inconsistent.
Second question
Third question And if, as in question 2 above, I set every param to 0 if it was undefined, I'd have to add something like this: Surely there's a better way? TIA
Back to
Seekers of Perl Wisdom
|
|