From: yitzle <[EMAIL PROTECTED]>
> The '/' is used on Unix, but not on Windows.
> Try replacing it with a '\'
> open(READFILE1,"<.\Sample_text_file.txt") or die ("Cannot open the given
> file");
> Or maybe just drop the './' entirely.
Wrong and wrong.
1) Most system calls do not give a damn whether you use forward or
backward slashes, The backward slashes are only needed if you are
passing the path to an external program, in the open() call you can
use both.
2) If you use a backslash in a doublequoted string you have to DOUBLE
IT!
Try
print "<.\Sample_text_file.txt";
You are right though that it's best to drop the ./ though.
Ayesha, are you sure the file exists? And are you sure the current
working directory is what you think it is?
use Cwd;
print "CWD: ", getcwd(), "\n";
Jenda
===== [EMAIL PROTECTED] === http://Jenda.Krynicky.cz =====
When it comes to wine, women and song, wizards are allowed
to get drunk and croon as much as they like.
-- Terry Pratchett in Sourcery
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/