#!/usr/bin/perl use strict; use warnings; use Data::Dumper; use Storable qw(store_fd fd_retrieve); use IO::Zlib; my $path = "/tmp/file"; my %hash = (name => "Mika", age => 30); # <-- fest-codierte Werte! my $hash = ( -r $path)? fd_retrieve(IO::Zlib->new($path, "rb")) : \%hash; print Dumper($hash); # neues zufälliges wertepaar $hash->{join('',map{chr(int(rand(25))+65)}(1..4))}=int(rand(50)); store_fd ($hash, IO::Zlib->new($path, "wb"));