use Data::Dumper qw/Dumper/; use IO::File; use strict; my %hash = { # Your data structure lies within %hash }; my $fn = "dump." . sprintf("%04d%02d%02d", (localtime)[5] + 1900, (localtime)[4] + 1, (localtime)[3]); my $fd = IO::File->new($fn, "w"); if (defined $fd) { print $fd Dumper(\%hash); $fd->close; };