in reply to Re^2: Windows file read
in thread Windows file read
I'm not very familiar with PerlIO (:utf8, etc). I suspect that if you do
open IN, '<:utf8', $fn or ...; binmode(IN); # Short for binmode(IN, ':raw') in v5.8
you will lose the :utf8 property. You could try
open IN, '<:raw:utf8', $fn or ...;
but :raw and :utf8 might be mutually exclusive. Fortunately, it's easy to try these and see if they work.
Update: This page says the previous snippet will work. Your code would look like:
local $/ = "\x0D\x0A"; open(local *IN, '<:raw:utf8', $filename) or die("Unable to open input file $filename: $!\n"); while (<IN>) { chomp; s/\x0A/ /g; ... }
|
|---|