grashoper has asked for the wisdom of the Perl Monks concerning the following question:
I am sure this is a pretty easy question but I am really new and don't totally understand how to access hash elements to get what I need.Process form variables for both POST and GET methods. # Below Will process all query string variables. if ($ENV{'REQUEST_METHOD'} eq "GET" || $ENV{'QUERY_STRING'} ne "") { @pairs = split(/\&/, $ENV{'QUERY_STRING'}); foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); # Split into name and value. $$name = $value; # Assign value to scalar matching name. $$name =~ s/%(..)/chr(hex($1))/ge; # Decode encoded stuff. $$name =~ s/\+/ /g; # substitute +'s for spaces. } } #Home page (and default opening topic): TEMPO 5 Help #Topics-01-1.html #Home would be returned in the querystring as value for topic..
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: using hash to lookup value
by naikonta (Curate) on Oct 16, 2007 at 02:54 UTC | |
by grashoper (Monk) on Oct 16, 2007 at 03:52 UTC | |
by Gangabass (Vicar) on Oct 16, 2007 at 04:07 UTC |