my @var = ( [qw(Hund Katze Maus)], [qw(Hund Katze Ratte)], [qw(Hund Tiger Ratte)], [qw(Hund Tiger Maus)], ) my $hashref = {}; for my $arr ( @var ) { my $tmp = $hashref; for(@$arr) { $tmp->{$_} = {} unless( exists $tmp->{$_} ); $tmp = $tmp->{$_} } } print Dumper $hashref;