in reply to Building data structures from CGI params
You mean you want to fetch the parameter list as a hash? It's right in the CGI documentation.
Update Ah - now I see, you want to do some "structured" parameters. No, I'm not aware of something like that, but if you go for dots as delimiters, it's fairly easy to write yourself:
my %params = $q->Vars; my @keys = keys %params; for my $k (sort @keys) { if (/[.]/) { my $v = delete $params{ $k }; my $level = \%params; my @items = split /[.]/, $k; my $key = pop @items; for (@items) { $level->{ $_ } ||= {}; $level = $level->{ $_ }; }; $level->{ $key } = $v; }; };
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Building data structures from CGI params
by fullermd (Priest) on Nov 21, 2010 at 09:53 UTC | |
Re^2: Building data structures from CGI params
by fullermd (Priest) on Nov 29, 2010 at 04:10 UTC | |
by Anonymous Monk on Jul 27, 2012 at 09:36 UTC | |
by fullermd (Priest) on Aug 07, 2012 at 22:31 UTC | |
by Anonymous Monk on Aug 08, 2012 at 03:26 UTC | |
by fullermd (Priest) on Aug 08, 2012 at 17:36 UTC | |
|
In Section
Seekers of Perl Wisdom