my $value = @{ [ $q->param('foo') ] } > 1 ? [ $q->param('foo') ] : $q- +>param('foo');
The above snippet creates an array ref and then derefences it, so it can check the number of elements. If it's greater than one, it creates array ref.
[ ar0n ]In reply to (ar0n) Re: CGI.pm: Can param return array ref?
by ar0n
in thread CGI.pm: Can param return array ref?
by DBX
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |