in reply to command prompt help

As turnstep already pointed out QUERY_STRING is just an environment variable.
bash $ ( export QUERY_STRING="foo=bar&baz=foo+bar"; perl x.pl) tcsh $ (set QUERY_STRING="foo=bar&baz=foo+bar"; perl x.pl)
to see a list of all Environment variables available to your script you might want to try the following in as a cgi-script:
#!/usr/bin/perl $\="\n"; $,="="; print "Content-Type: text/plain\n"; map{print $_, $ENV{$_} } keys %ENV;