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

Presumably you know what you expect; if you have a first_name parameter, fetch the value in scalar context.

If you do need a truly generic solution, always call param() in list context; stuff the values into an array and check the number of elements of the array. If it's one, you have one value. If it's more than one, you have a list of values.