in reply to JSON to HASH
so I can reference it as $hashname{keyname} instead of having to use $hashname->{keyname}
Leaving aside issues about the problems with processing query strings in this way ....
How are you using the subroutine you posted?
Because if you use it in the only way that seems sensible, it produces the result you want:
sub QueryData { $QD_In = $_[0]; @QD_Pair = split('&',$QD_In); %QD_Out = map{split('=',$_,2)} @QD_Pair; return (%QD_Out); };; %hash = QueryData( 'fred=1&Bill=2&John=3' );; print $hash{fred};; 1 print $hash{John};; 3
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: JSON to HASH
by PriNet (Monk) on May 15, 2016 at 04:57 UTC | |
by BrowserUk (Patriarch) on May 15, 2016 at 06:32 UTC | |
by PriNet (Monk) on May 15, 2016 at 06:49 UTC | |
by PriNet (Monk) on May 15, 2016 at 22:34 UTC | |
by AnomalousMonk (Archbishop) on May 15, 2016 at 23:23 UTC | |
by PriNet (Monk) on May 16, 2016 at 00:45 UTC |