in reply to printing chr(10) to a file adds chr(13) infront
open(BINARYFILE, ">file") or die "can't open file for writing: $!"; binmode(BINARYFILE); [download]