##
open IN, '<:raw:utf8', $fn or ...;
####
local $/ = "\x0D\x0A";
open(local *IN, '<:raw:utf8', $filename)
or die("Unable to open input file $filename: $!\n");
while () {
chomp;
s/\x0A/ /g;
...
}