Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Question about URL query strings

by kennethk (Monsignor)
on Feb 17, 2014 at 23:10 UTC ( #1075232=note: print w/ replies, xml ) Need Help??


in reply to Question about URL query strings

You mistake is (almost assuredly) in assigning it to a hash. Rather than code that says:

my %param = URI->new('/?foo=Zoo&foo=aha')->query_form;
you should respect that you have multiple values associated with a given key, and use hashes of arrays (perllol, HASHES OF ARRAYS):
my @list = URI->new('/?foo=Zoo&foo=aha')->query_form; my %param; while (@list) { push @{$param{shift @list}}, shift @list; }
or something similar.

#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.


Comment on Re: Question about URL query strings
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (5)
As of 2014-07-28 21:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (210 votes), past polls