Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Answer: Input arrays to CGI

by jeffa (Bishop)
on Jul 04, 2002 at 21:59 UTC ( #179539=categorized answer: print w/replies, xml ) Need Help??

Q&A > CGI programming > Input arrays to CGI - Answer contributed by jeffa

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' ];

Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (6)
As of 2016-12-05 12:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (81 votes). Check out past polls.