in reply to Usage of regular expressions in input separator

With PerlIO::via you can add a layer that converts whatever you want to line feeds. For example, if you want to accept CR and LF as line feeds:

package PerlIO::via::normeol; sub FILL { my ($obj,$fh) = @_; my ($c); my $n = read ($fh, $c, 1); return undef unless $n; $c =~ tr/\r/\n/; return $c; } 1; use PerlIO::via::normeol; open (A, "<:via(normeol)", "foo.bar"); while (<A>) { ...