in reply to Unexpected CGI param behavior
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.my @vals = $q->param('...'); print Dumper(\@vals); # would print [ undef ] not [ ]
A work-around is to use scalar:
my $var = { first => scalar $q->param('first'), second => scalar $q->param('second'), };
|
|---|