in reply to Using binmode on ARGV filehandle?

Your code can be shrunk to:
for my $file (@ARGV ? @ARGV : '-') { my $fh; if ($file eq '-') { open($fh, '-'); # "-" doesn't work with 3-arg open. binmode($fh, ':utf8'); } else { open($fh, '<:utf8', $file); } while (<$fh>) { do_whatever( $_ ) } }

Differences from using while (<>):