How can I make Data::Dumper write a dump into a file?
Data::Dumper
The question is a bit unclear, but are you looking for something like this?
open my $FH, '>', 'outfile'; print $FH Dumper(\%data); close $FH;
You can restore the data later by using eval.
eval