# 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)