Losing has asked for the wisdom of the Perl Monks concerning the following question:

I have an hmtl form that will have an unknown number of fields. In php if you name fields as so..
<input name="array[]" />
The fields with name=array will be sent as an array. Is this possible using the perl CGI module?

Replies are listed 'Best First'.
Re: form fields into array
by jettero (Monsignor) on Jan 12, 2007 at 21:39 UTC
    Yes, in fact, there's no way to avoid it. That is the default behavior.
    my @params = $cgi->param("arrayname"); # violla!
    You did ask specifically about CGI. The section you want is here.

    -Paul

      aghhh!!! Thanks for the reply. I was doing it that way, but I was leaving off the brackets when calling $cgi->param(). Works fine now! Thanks for the help.