for (my $i =0; $i<=$#werte; $i++) { $hash{$f} = {'RD29.0' => {$PrimKey => {$Key[$i]}}} = $werte[$i]; }