Help for this page

Select Code to Download


  1. or download this
    while (<$fh>) {
       # If the file contained lines ending with CRLF, $_ ends with LF
       # If the file contained lines ending with LF,   $_ ends with LF
       chomp;  # Removes LF
    }
    
  2. or download this
    while (<$fh>) {
       # If the file contained lines ending with CRLF, $_ ends with CRLF
       # If the file contained lines ending with LF,   $_ ends with LF
       s/\r?\n\z//;  # Removes CRLF or LF
    }