in reply to Unix and Windows CRLF vs LF

Presumably you have no way of knowing if the input records are terminated with \r\n or just \n without reading the records. Therefore I wouldn't alter $/ but instead:
while (<FILE>) { s/\r?\n$//; # If there is no \r, so what? # Random code }