in reply to perl CGI: No such file or directory yet file exists???

What is the value of $grades

Add the that var to the die statement to verify it holds what you expect.

open(GRADES,'<', $grades) or die "failed to open '$grades' $! (".($!+0).")\n";