http://qs321.pair.com?node_id=872769


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; }; };