I am trying to learn file handling in Perl, I want to open a .txt file located in D: drive on the terminal on Windows in read mode, so the code I am using is as:
open(DATA, "<D:/pay_info.txt") or die "Couldn't open file pay_info.txt, $!";
while(<DATA>)
{ print "$_";}
it always shows
Couldn't open file pay_info.txt, No such file or directory at C:\perl\perl2.pl line 1.
what does it mean?
Are you sure, that the file
D:/pay_info.txtexists? Perl is unable to locate that file on the base folder of driveD:(that is the meaning of the error message printed by yourdiestatement).