open $fh, ">$file" or die "Can't write $file $!\n"; print $fh "here is some data\n"; close $fh;