Always use open my $fh, '<:encoding(utf8)', $filename or die ...
, the 3-argument version of open
,
and never the old way.
Note the open call has 3 parameters:
-
The holder of the file-handle which has been just created.
open
will assign the file-handle to it. -
The mode of open. (to read, to write, to append, etc.)
-
Supply the encoding (utf8 in our case).
-
Path to the file.
Comment to the experts
In the rare cases when you must use the old version, you'll know it.