It will ask for name/value pairs and you enter them one per line such as$query = new CGI;
You would enter those for whatever value your script expects, if any. When you're done, or if you are not passing any name/value pairs to the script, hit control-D and the script will run. If you have a lot of name/value pairs, you can toss them into a file and usename=Irving color=Blue money=happiness
That will read the information from the file without you needing to retype it every time.$query = new CGI(FILENAME);
If you haven't used "new CGI" the program will run without asking for name/value pairs.
This may seem like a bit more work up front, but I find that it allows for a lot of quick and dirty debugging from the command line. You may also want to look into the Perl debugger. Once you get used to it, it's a wonderful tool.
Final note: not to be redundant, but the others are right when they say to never create a CGI script without -wT and use strict. A good source for initial information is a brief overview of Safe Scripting in Perl that can be found at perl.com. Also, on a Linux or Unix system with perl documentation installed, enter the following at the command line: <CODE> perldoc perlsec </
In reply to RE: Opening a file error
by Ovid
in thread Opening a file error
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |