in reply to command prompt help
QUERY_STRING is merely an environment variable, usually set by the web server and passed to your program. For a command line version, just set the environment variable to whatever you want, or use CGI as mentioned above.
A quick hack to get the program to work as you have typed it (the first version) is to add this to the top of your program:
Ugly, but it should work.$ENV{'QUERY_STRING'} = shift;
You may also need to add this line:
depending on what code you are using to parse the input.$ENV{'REQUEST_METHOD'}="GET";
|
|---|