| 1:18 pm on Apr 17, 2007 (gmt 0)|
Can't help you much on this one, but for further debugging I would extend the `die`-string to include the $datafiles variable to get an idea of its exact content at the time the script breaks, and then start from there:
... or die "couldn't open datafile $datafiles -- $!";
| 1:40 pm on Apr 17, 2007 (gmt 0)|
ok, I think this is it.
Take the filename in your open statement: $datafiles/maint.html
and resolve $datafiles D:\FTP\cym\htdocs\cgi-bin\inn-i/maint.html
See that? Try changing your open line to "<$datafiles\\maint.html". You have to use a double \ as it's a special character.
| 5:38 pm on Apr 17, 2007 (gmt 0)|
this is not a problem:
but it's a good habit to get into to use all forward slashes in directory paths, even if you are on windows, it will not matter:
this avoids unwanted meta character interpolation if you use the back-slashes in a string that gets interpolated. In this case, the single-quotes would have avoided that but still better to use forward-slashes as a rule.
The problem appears to be that the path or the filename is not correct.
| 10:07 pm on Apr 17, 2007 (gmt 0)|
Thanks perl_diver, I have used both on Win32, but didn't know about mixing them.
In that case the only thing I could suggest is that maybe inn-i isn't supposed to be in the path, or maybe the maint.html is in the wrong directory. It may be a security issue, if you're on Windows Server you're probably using IIS, check that IUSR_#*$!#*$!x has access to the file.
Also try Romeo's suggestion of adding $datafiles to the error message, this will allow you to definitively check the correct path.
| 1:06 am on Apr 18, 2007 (gmt 0)|
"No such file or directory" means it can't be found. "Permission denied" would mean the file is either open (a windows thing) or the user (or maybe the script) does not have permission.
| 4:27 am on Apr 18, 2007 (gmt 0)|
|$datafiles = 'D:\FTP\cym\htdocs\cgi-bin\inn-i'; |
could it be a case sensitivity problem?
i noticed your error message refers to this directory with an uppercase H for "Htdocs" in the script path:
|couldn't open datafile No such file or directory at D:\FTP\cym\Htdocs\cgi-bin\inn-i.pl line 1405... |
| 11:24 am on Apr 18, 2007 (gmt 0)|
Nope, Windows filesystem is not case sensitive.
| 2:14 pm on Apr 19, 2007 (gmt 0)|
$datafiles = 'D:/FTP/cym/htdocs/cgi-bin/inn-i';
$file = $datafiles.'/maint.html';
open (IN, "< $file") or die "couldn't open datafile $file $!";
I think you had two problems the \ instead of / and the concentrated string in the open function.