open( INPUT, "<:raw", "some_file.utf8" ) or die "bleah: $!"; { local $/; $_ = ; } my $nbytes = length(); my $nchars = tr/\x00-\x7F\xC2-\xFF//;