Although the issue has been solved in a few different ways, I'd like to point out that one should be using the three-argument form of open (I always prefer to use a variable as opposed to bareword too):
my $filename = "/path/to/filename.txt"; open my $fh, '<', $filename; or die "Can't open the file $filename for reading: $!";
EDIT: AnomalousMonk pointed out my brain fart usage of the filehandle instead of a variable in the die statement. Fixed
-stevieb
In reply to Re: Cannot print line
by stevieb
in thread Cannot print line
by nimpoura
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |