Try this (hope'll work)
$pathto='c:/perl/eg/grades.txt'
open (GRADES,$pathto) or die
It works in Unix for sure , and probably in W too
If you use the file grade.txt for many times in your script and if you change it's
location , you'll change your script just once in the "pathto" variable
you might want to avoid the complexity here and just say:
open(GRADES, "grades.txt");
your problem are the \ marks... you'll need to use \\ in your example,
seeing that \ is the escape character
iirc, you can use / in perl paths too, even on a windows machine, but i'm
not 100% on that one.
try i
i'm a newbie too, but try this-
use slashes instead of backslashes, perl sees backslashes as escapes, so this:
open(GRADES, "c:\perl\eg\grades.txt") or die "Can't open grades: $!\n";
should be:
open(GRADES, "c:/perl/eg/grades.txt") or die "Can't open grades: $!\n";
lemme know if that helps!
Cu