use strict; use warnings; open my $file, '>', 'file; binmode($file); #more code here #then finally: