in reply to Passing arrays to a CGI
The %data hash will the contain all of the name/value pairs from the forms. With the complete hash, you can manipulate the data at will.#!/usr/bin/perl -Tw use strict; use CGI; my $query = new CGI; my @keys = $query->param; my %data; # Do NOT use this code. It is very insecure and for illustration purp +oses only! # Individual elements are untainted and may be dangerous! for (@keys) { $data{$_} = $query->param($_); }
If, for some reason, you have more than one value for a name, the hash will contain (if I recall correctly) a reference to an array for that name with the elements of the array being the values.
Cheers,
Ovid
Join the Perlmonks Setiathome Group or just go the the link and check out our stats.
|
|---|