# read info # and then we are ready to build our filename # unless you are writing binary data, the following should # do the trick. $time = time; $filename="myfile_".$time.".txt"; # (and then just print using $filename) #### $time = scalar localtime; $time =~ tr/ /_/; #get rid of the spaces; $filename = "myfile-".$time.".txt";