in reply to CGI.pm: Can param return array ref?
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 ]
|
|---|