I have a Perl script that dumps a hash into an 'output.txt' file. The problem is, every time I run this script, the same 'output.txt' file gets overwritten. How do I generate a new '.txt' file every time I run the script so that I have the results in separate files for each run?
I have something like this right now at the end of my perl script:
print Dumper( \%data );
open my $temp, '>', 'output.txt' or die $!;
print $temp Dumper \%data;
close $temp;