Home: Perl Programming Help: Beginner:
finding file paths

New User

Oct 12, 2017, 10:50 AM

Views: 2389
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

use strict; 
use warnings;

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

my $protein = <PROTEIN>;

print 'success';

close (PROTEIN);


Thanks in advance

Veteran / Moderator

Oct 12, 2017, 11:09 PM

Views: 2385
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?