Home: Perl Programming Help: Beginner:
finding file paths



spoon4000
New User

Oct 12, 2017, 10:50 AM


Views: 2275
finding file paths

Im literally trying to make it do the simplest thing. I just want it to successfully locate a file but it always give me this error.

No such file or directory at C:\Users\***\perl\reading.pl line 8.

I know the file is there, I put it there. why won't the program look where i'm telling it to look


Code
use strict; 
use warnings;

open (PROTEIN, '<','C:\\Users\\***\\Documents\\protein_data\\NM_021964.txt',) or die $!;

my $protein = <PROTEIN>;

print 'success';

close (PROTEIN);

exit


Thanks in advance


Laurent_R
Veteran / Moderator

Oct 12, 2017, 11:09 PM


Views: 2271
Re: [spoon4000] finding file paths

Do you actually have a subdirectory called "***"? Or do you mean these three asterisks to be a wildcard for any subdirectory having itself a \\Documents\\protein_data subdirectory tree?