# ... read into $line chomp $line; $line =~ s/\r$//; # ... carry on