Help for this page
my $bom; open IN, $filename or die $!; ... # you've already read the bom, so just move on and read the data } close IN;
my $size = -s $filename; $size = 128 if $size > 128; ... # this is probably a utf16 file (if it's text at all) } close IN;