Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re: Unexpected CGI param behaviorby pc88mxer (Vicar) |
on Jun 24, 2008 at 00:47 UTC ( [id://693640]=note: print w/replies, xml ) | Need Help?? |
I think CGI implements this behavior so that param() can support both scalar and list context. In list context it returns all the values for a parameter and in scalar context it just returns the first value.
If it returned undef for unknown parameters, then this wouldn't work: That is, @vals would not be the empty list but a list containing undef. A work-around is to use scalar:
In Section
Seekers of Perl Wisdom
|
|