I\'m maintaining a script that can get its input from various sources, and works on it per line. Depending on the actual source used, linebreaks might be Unix-style, Windows
$line =~ s/[\r\n]+//g;