Help for this page

Select Code to Download


  1. or download this
    my $newline;
    for my $test ("\015\012","\015","\012") {
    ...
      $newline = $test;
      last if /$test/;
    }
    
  2. or download this
    # Default to unix.
    my ($newline) = /(\015\012|\015|\012)/ ? $1 : "\012";
    
  3. or download this
    # Default to unix.
    my ($newline) = /(\015\012?)/ ? $1 : "\012";