in reply to Passing arrays to a CGI

CGI.pm already does this in a fashion:
<input name='form_item' value='one'> <input name='form_item' value='two'> <input name='form_item' value='three'>
And the resulting Perl:
my $q = new CGI; print join(",", $q->param('form_item')); # one,two,three
In cases where more than one form element uses the same name, CGI.pm will return them as an array, if you call the param method in a list context. Is this what you meant?

Replies are listed 'Best First'.
RE: Re: Passing arrays to a CGI
by arturo (Vicar) on Sep 20, 2000 at 23:26 UTC

    Gah! I shoulda known it was that simple. I think the comments in the CGI.pm documentation say this (now that you point it out), but they say it a little cryptically =) Thanks!

    Philosophy can be made out of anything -- or less