The recommendation these days is to use the three argument form of open, lexical filehandles rather than package filehandles (i.e. $fh rather then IN) and to check for the success of the operation, showing the O/S error ($!) in the error message on failure.
... my $inputFile = q{/path/to/myFile; open my $inputFH, q{<}, $inputFile or die qq{open: < $inputFile: $!\n}; ...
I hope this is helpful.
Cheers,
JohnGG
In reply to Re^3: reading files from a directory
by johngg
in thread reading files from a directory
by kevyt
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |