($fh, $filename) = tempfile($template, DIR => $dir) or die " $progname: Error creating $filename: $!"; #### print $fh "\nS'working?\n" or die "$progname: Error writing to $filename: $!"; close ($fh) or die "$progname: Error closing $filename: $!"; print "Printed data to $filename\n";