in reply to Cannot print line
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Cannot print line
by AnomalousMonk (Archbishop) on Nov 28, 2014 at 16:20 UTC | |
by stevieb (Canon) on Nov 28, 2014 at 16:31 UTC |