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:

  1. The holder of the file-handle which has been just created. open will assign the file-handle to it.
  2. The mode of open. (to read, to write, to append, etc.)
  3. Supply the encoding (utf8 in our case).
  4. Path to the file.

Comment to the experts

In the rare cases when you must use the old version, you'll know it.