This technically a homework problem but I just need help solving this strange issue. The code is kinda long, I tried posted only the relevant parts.
- The problem statement, all variables and given/known data:
I receive this error:
got error No such file or directory (2)
at:
open(GRADES,"<<$grades") or die "got error $! (".($!+0).")\n";
line 49 in CreateExam.pm called from submit.cgi, linked below.
- Relevant commands, code, scripts, algorithms:
submit.cgi:
my $check = CreateExam->new("/var/www/roger/homeworks/hw13/exam4.txt","/var/www/roger/homeworks/hw13/answers4.txt","/var/www/roger/homeworks/hw13/grades4.txt",$pathroot);
CreateExam.pm:
sub new {
my ($class,$file,$answers,$grades,$script) = @_;
#print "<p>in new: file: $file, grades: $grades</p>\n";
return bless {'file'=>$file,'answers'=>$answers,'gradefile'=>$grades,'script'=>$script},$class;
}
my $grades = $self->{'gradefile'};
open(GRADES,"<<$grades") or die "got error $! (".($!+0).")\n";
- The attempts at a solution (include all code and scripts):
I tried all of those recommendations: I remove any whitespace, I put in a check for any nonprintable characters, I hard-coded the path.
To make sure it wasn't a permissions issue, I installed suExec-custom for debian, all cgi scripts run under my UID, that didn't help.
I'm running this on debian with Apache
- Complete Name of School (University), City (State), Country, Name of Professor, and Course Number (Link to Course):
SUNY Polytechnic, Formerly SUNY Institute of Technology
100 Seymour Rd Utica NY 13502
CS 351 Web Development and Internet Programming
Scott Spetka scott@sunyit.edu