Help for this page

Select Code to Download


  1. or download this
     open(my $fh, '<', $filename);
     binmode($fh);
    
  2. or download this
    open(my $fh, "<:raw:perlio", $file);
    
    ...
    #  to determine encoding
    
    binmode $fh, ":encoding($encoding)"
    
  3. or download this
    open $fh, "<", $^X or die;
    binmode $fh;
    ...
    print "2: ", join(' ', PerlIO::get_layers($fh, details => 1)), "\n";
    close $fh;
    
  4. or download this
    1: unix  4195328 crlf  4195328
    2: unix  4195328 perlio  4195328