You should only attempt to use a filehandle if open returned a true value. Try something like this instead:
foreach my $file ( @files ) { open FH, '<', $file or do { warn "Cannot open '$file' $!"; next; }; my @fileContents = <FH>; close FH; //Do something with @fileContents }
In reply to Re: File read errors
by jwkrahn
in thread File read errors
by sachinmkulkarni
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |