Help for this page

Select Code to Download


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