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

Re^3: dynamically built form getting data parameters

by hippo (Bishop)
on Jun 10, 2016 at 15:33 UTC ( [id://1165301]=note: print w/replies, xml ) Need Help??


in reply to Re^2: dynamically built form getting data parameters
in thread dynamically built form getting data parameters

OK, let's suppose you use CGI::Lite. Here's a simplistic script you might write to process any number of batches of fields:

#!/usr/bin/perl -T use strict; use warnings; use CGI::Lite (); print "Content-type: text/plain\n\n"; my $cgi = CGI::Lite->new (); my $params = $cgi->parse_form_data; my $i = 0; while ($i <= $#{$params->{Professor}}) { print "Professor $i is $params->{Professor}->[$i]\n"; print "IDNum $i is $params->{IDNum}->[$i]\n"; # ... carry on with other fields here $i++; }

Update: See also the get_multiple_values convenience method in the documentation which is a benefit if you don't know for sure that there will be more than one of each item.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1165301]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (5)
As of 2024-04-18 06:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found