http://www.perlmonks.org?node_id=200429


in reply to chomp() problems

chomp will only remove the systems $/ ($INPUT_RECORD_SEPARATOR). In most Unix it is just \n, in DOS it's \r\n.
I guess you could fix the problem by:
{ local $/ = "\r\n"; chomp ($line); }
Edited to correct typo, and again edited to correct a typo and again edited to fix a type. A sick infant does wonders to your sleep habits, and therfore your typing skils ;) Note to self, do not post anything after cleaning up baby vomit. ;)