in reply to mac win and unix EOL chars, $/ question
the /[^\r]/ will match any string which has a non \r character so the string "\r\n" will match because the \n is not a \r. what you want is:if ($_ =~ /[^\r]/ && $_ =~ /\n/) { $os = "unix"; $/ = "\n"; }
|
|---|