There once was a girl named Michelle
Who came louder than Notre Dame’s bell.
A pillow in her face,
Saves the neighbors disgrace;
Their wives don’t come nearly so well.
…Well, well, well you never can tell…
[close]
Permanent link · http://querylog.com/q/There+once+was+a+girl+named+Michelle
You can certainly parse it out of $ENV{QUERY_STRING} yourself but there are at least two problems with that.
1) You have to really know what you’re doing or you’ll flub it. E.g., & and ; are both legitimate key=value separators, and multiple arguments (foo=bar;foo=baz) are valid for single keys which is not the default hash behavior.
2) If you really know what you’re doing you won’t waste your time writing it when one of the Saints of Perl already has done it for you in the URI modules.
use URI;
use URI::QueryParam; # adds the query_param functionality
my $uri = URI->new($ENV{HTTP_REFERER});
for my $key ( $uri->query_param ) {
print "$key: ",
join(", ", $uri->query_param($key)), "\n";
}
[close]
Permanent link · http://querylog.com/q/%22query_string%22+perl+hash