in reply to Getting back values of an array of names reurned by CGI when the names are variables

Here is how i would handle it, if i read you correctly. Preface your hidden variables with user_ and then grep those values from CGI::param() like so:

use strict; use warnings; use Data::Dumper; use CGI qw(param); my %user = map {$_ => param($_)} grep /^user_/, param(); print Dumper \%user;
You can test this snippet on a command line like so:
./foo.pl "user_foo=bar&user_bar=baz&something=else"

jeffa

L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(the triplet paradiddle with high-hat)
  • Comment on Re: Getting back values of an array of names reurned by CGI when the names are variables
  • Select or Download Code