When you know that you have windows line separators, I prefer to handle them the same way that perl on windows does. Use the "IO Layer" crlf. Add the statement
binmode STDIN, ':crlf';
before your input loop.
Bill
Comment on Re^2: Why is my code producing weird output?