in reply to First attempt at bringing in file for input/output
Firstly I would NOT use autodie until you've learned how to deal with files without it.
It's a shortcut for people that know what they are doing (and you're not quite there yet).
Then ALWAYS use strict;. ALWAYS. Absolutely ALWAYS.
The normal idiom for opening filehandles is this:
This declares a lexical file-handle and opens it, dying if there is an error.open my $fh, "<", "blah.txt" or die $!;
Feel free to modify it, once you understand what it does.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: First attempt at bringing in file for input/output
by pryrt (Abbot) on Oct 20, 2018 at 20:22 UTC |