Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

Re: CGI::Vars weirdness

by gam3 (Curate)
on Apr 04, 2008 at 02:20 UTC ( #678314=note: print w/replies, xml ) Need Help??

in reply to CGI::Vars weirdness

I am confused by you problem.

If you would like to have the QUERY_STRING directly you can parse $ENV{QUERY_STRING};

my @values = split(/&/,$ENV{QUERY_STRING}); foreach my $i (@values) { my ($name, $value) = split(/=/, $i); push(@{$keys{$name}}, $value); }
Note that this has a slightly different structure that the structure ruturned by CGI::Vars.
-- gam3
A picture is worth a thousand words, but takes 200K.

Replies are listed 'Best First'.
Re^2: CGI::Vars weirdness
by chromatic (Archbishop) on Apr 04, 2008 at 05:38 UTC

    The semicolon is also a valid separator for key-value pairs in URL-encoded query strings... but don't parse query strings by hand. You'll get it wrong.

      Not quite. ";" is a valid separator for HTTP URLs, but not for application/x-www-form-urlencoded (i.e. form) data.

      In other words, you may assign URLs any meaning you wish to ";" in URLs to resources you control, but it's by no means equivalent to "&" unless you choose it to be for those resources. You shouldn't impose your choice as fact onto others.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (3)
As of 2022-12-05 08:11 GMT
Find Nodes?
    Voting Booth?

    No recent polls found