I'm rather new to programming with CGI, and though I do use open source to get ideas, I like programming my own.
I have this problem when I wrote a script for a mini-messageboard for my website.
I have the following files in my subdomain directory:
main.cgi
main.htm
settings.pl
load.pl
Now the main.cgi file used to contain the lines
require "settings.pl";
require "load.pl";
The "load.pl" line was always returning an error as file not found in the error logs. The "settings.pl" line does successfully load. In the end I decided to just put all the .pl files into the main.cgi file to save myself the trouble.
Unfortunately I left that problem hanging. Later on as I was adding lines, I wrote:
open (HTMLFILE,"< main.htm") || die $!;
which returned a no file found error. I also tried
open (HTMLFILE,"main.htm") || die $!;
open (HTMLFILE,"./main.htm") || die $!;
open (HTMLFILE,"/home/www/marher4.goldeye.info/main.htm") || die $!;
all to no avail.
I decided to see if my folder was just incorrect so I tried
open (HTMLFILE,"+>> main.htm") || die $!;
print HTMLFILE "blah blah blah";
which did end up writing to the main.htm.
I'm confused... Is there something wrong with what I'm doing?
|