Be careful, when you use chomp; you need to be aware what it does.
chomp removes the current input record separator from the string. This is the value stored in $/. On *nix systems this defaults to "\n". If you're reading stuff from the interwebs or from text files created on dos systems, then the end of the lines will likely be crlf or "\r\n". Using chomp will therefore remove the linefeed but not the carriage return, which is what you found.
There are a number of solutions, but the easiest is probably to change the value of $/:
local $/ = "\r\n";In reply to Re^3: Problem using chomp on linux
by Nomad
in thread Problem using chomp on linux
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |