in reply to Chomp doesn't seem to work

assuming you are reading in input line by line, maybe it would be easier just to clean the line to make sure it's in the right format. Like

chomp(my $line = <FILE>); $line =~ tr/\r//d;