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 }