Help for this page

Select Code to Download


  1. or download this
    sub guess_newline {
      my $file = shift;
    ...
      close $F;
      return $sep;
    }
    
  2. or download this
    {
       local $/ = guess_newline($filename) || die "Can't guess sep for $fi
    +lename";
       open my $IN, '<', $filename or die "Can't read $filename: $!";
       while (<$IN>) { ... }
    }