perl -pi.bak -e "BEGIN{binmode(STDOUT)}" file1 file2