One way is to detect line-endedness
$first_line =~ m@((\r)?\n)@ and $NL = $1;and then use $NL for any newlines, but I wonder if there isn't a niftier, Perlish way?
In reply to Line endedness by mobiGeek
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |