in reply to Opening a file error

If you're trying to debug a CGI script, one thing you can do is run the program from the command line. If you have instatiantiated a new CGI object
$query = new CGI;
It will ask for name/value pairs and you enter them one per line such as
name=Irving color=Blue money=happiness
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 use
$query = new CGI(FILENAME);
That will read the information from the file without you needing to retype it every time.

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 </