in reply to CGI.pm: $q->param can be an array. Can be a single value. How do you know which?

Both CGI and CGI::Simple store the param values internally as:

{ key => [ val ], key2=> [ val1, val2, ... ] }

So the values are really always 'arrays' (well array refs) but if there is one val it is a single element array.

The param method is sensitive to context via wantarray so if you call it in list context you get all the values, but in scalar context you get val->[0]. The || operator forces scalar context which is why your syntax does not work.

The easy way to do it is just assume you have a list, and loop through it. Looping through a list of one is quick ;-)

cheers

tachyon