note
Laurent_R
That's wrong in this specific case. Here, you have a Windows file with "\r\n" line ends. Under Unix, the chomp command will remove only the "\n" part, but not the "\r". Using chomp a second time will not remove the "\r" under Unix. So the printing goes back to line start and the three !!! overwrite the beginning of the line.
<p>
The best solution here is to remove the "\r":
<c>
chomp $line;
$line =~ s/\r//g;
</c>
or
<c>
$line =~ s/[\r\n]//g;
</c>
</p>
1090256
1090319