perl -MText::CSV_XS -MIO::File -e '$/="\r"; $f = IO::File->new_tmpfile; print $f "a,b,c$/"; seek($f,0,0); $c = Text::CSV_XS->new({eol => $/}); print join("|",@{ $c->getline($f) })'