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"; }
In reply to Re: mac win and unix EOL chars
by nardo
in thread mac win and unix EOL chars, $/ question
by daemonchild
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |