my $fh ; open ($fh,">$file") ; binmode($fh) if $unicode ; print $fh $data ; close ($fh) ;