perl -pe "BEGIN {binmode(STDOUT)}" < in_file > out_file