Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^2: Why is my code producing weird output?

by BillKSmith (Monsignor)
on Sep 01, 2023 at 18:49 UTC ( [id://11154223] : note . print w/replies, xml ) Need Help??


in reply to Re: Why is my code producing weird output?
in thread Why is my code producing weird output?

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