in reply to Re^2: CGI Input with Escaped Characters
in thread CGI Input with Escaped Characters

You can pass CGI parameters on the command, using data=foo api_key=1234. See the DEBUGGING section of CGI. But I doubt that CGI will shoehorn that back into %ENV.

You could set the environment variable on the command line also

$ env QUERY_STRING=data=foo&api_key=laurel%26hardy script.cgi

or you could check inside your script if it is run from the commandline:

if (-t STDIN) { # command line. for params, substitute special chars (e.g. & => %2 +6) # (there must be a module out there which does that for you) } else { # via webserver }
perl -le'print map{pack c,($-++?1:13)+ord}split//,ESEL'