open(my $fh, '>', file); binmode($fh); print $fh ...