That's why I usually use $line=~tr/\015\012//d.
This removes any CR and LF from $line. It works fine as long as you don't care for empty lines.
In reply to Re^2: the chomp does not seem to work
by Skeeve
in thread the chomp does not seem to work
by steph_bow
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |