I am not a programmer but have a perl programme which I have recently transferred from a NT4 server to a Windows 2003 server. Everything else is the same except possibly a different version of Perl is running on the server.
I get the following error message:
Software error:
couldn't open datafile No such file or directory at D:\FTP\cym\Htdocs\cgi-bin\inn-i.pl line 1405.For help, please send mail to this site's webmaster, giving this error message and the time and date of the error.
The code around line 1405 is as follows:
print $IN->header;
print $IN->start_html("Innovation Software Superuser Maintenance Page");
open IN, "<$datafiles/maint.html" or die "couldn't open datafile $!";
while (my $line = <IN>){
$line =~ s/_INN_EXEC_/$inn_exec/g;
print $line;
}
And the file containing the datafiles reference says:
$datafiles = 'D:\FTP\cym\htdocs\cgi-bin\inn-i';
I can confirm that this folder exists and maint.html exists.
Could anyone help me correct the error please?
Thanks,
Chris
D:\FTP\cym\htdocs\cgi-bin\inn-i/maint.html
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:
D:/FTP/cym/htdocs/cgi-bin/inn-i/maint.html
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.
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.