Windows text files have '\r\n' at the end of a line while linux/unix text files have only \n at the end. So if you give a windows text file to perl on linux chomp expects and removes only the \n and leaves the \r, which basically returns the cursor to the beginning of the actual line (not the next one). Example of the \r effect: