Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Answer: Input arrays to CGI

( #179539=categorized answer: print w/ replies, xml ) Need Help??

Q&A > CGI programming > Input arrays to CGI 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' ];

Comment on Answer: Input arrays to CGI
Select or Download Code
Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (5)
As of 2014-09-19 21:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (147 votes), past polls