CGI.pm will handle this. All you need to do is
request the multi-value parameter as a list:
use strict;
use CGI qw(param);
use Data::Dumper;
my @list = param('list');
print Dumper \@list;
Run this on the command line like so:
./foo.pl 'list=foo&list=bar&list=baz&list=qux'
and you should see the following:
$VAR1 = [
'foo',
'bar',
'baz',
'qux'
];
| [reply] [d/l] [select] |
Are you posting in the right place? Check out Where should I post X? to know for sure.
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following: a, b, big, blockquote, br, caption, center, col, colgroup, dd, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, li, ol, p, pre, readmore, small, span, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul
Snippets of code should be wrapped in <code> tags not tags. In fact, tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible editor intervention).
Want more info? What shortcuts can I use for linking to other information? or Writeup Formatting Tips are good places to start.
| [reply] |