use Data::Dumper; my $complexVar = { a => 1, b => [2,3,4], c => 5 }; unless (open FH, ">$file")) { die "Error in opening '$file' for writing: $!\n"; } print FH Dumper($complexVar); close (FH); undef($complexVar); # weg issi my $complexVar2 = &ReadDump($file); sub ReadDump { my $file = shift; local $/; # undef, alles auf einmal einlesen open (FH, $file) or die "Error in reading '$file': $!\n"; my $string = ; close (FH); my $var = eval $string; return $var; } # ReadDump