#!/usr/bin/perl use strict; use warnings; use Encode; use utf8; use open ':utf8'; binmode STDIN, ":utf8"; binmode STDOUT, ":utf8"; my $fn = shift @ARGV; my $fh; # A open $fh, "<", $fn or die $!; print while <$fh>; close $fh; # B open $fh, "<:utf8", $fn or die $!; print while <$fh>; close $fh; # C open $fh, $fn or die $!; print while <$fh>; close $fh; # D open $fh, "< $fn" or die $!; print while <$fh>; close $fh;