in reply to Re^2: Process file regardless of the platform it was created on
in thread Process file regardless of the platform it was created on

I guess a s/\r\n/\n/g followed by chomp would do it

That substitution is exactly what the crlf PerlIO layer is doing (on input). The layer is by default in effect when you're on Windows (which is why you don't have the problem with Windows' files on Windows :)

In other words, you could also do

open($fh, "<:crlf", "foo.txt") or die "failed to open 'foo.txt':$!";