in reply to Re^2: Minimize Hash Key Value Combinations
in thread Minimize Hash Key Value Combinations

"if you take a closer look" to what you said:

> the result should look like this:¹

[a, b, c, d] => [1, 2] [b, c] => [2]

which doesn't make sense, don't you agree?

You are talking about a "hashtree" but the data shown has nothing to do with HoH.

The data shown isn't even valid Perl, keys are strings never arrays.

have a look at How (Not) To Ask A Question

Asking a good question is often the best answer! :)

Cheers Rolf

( addicted to the Perl Programming Language)

¹) OP updated now...

Replies are listed 'Best First'.
Re^4: Minimize Hash Key Value Combinations
by AlexTape (Monk) on Nov 18, 2013 at 14:20 UTC
    first you are right.. i made the result manually.. that was a simple mistake.. :)

    actually it is an hash tree.. but i dont want to deflect the problem with code snippets..
    keys are strings never arrays
    i dont agree.. just take a look at Hash::Multikey or perldsc or maybe it is a nested structure like this:
    #!/usr/bin/perl -w use strict; use warnings; my %hash; $hash{'number'}{'even'} = [24, 44, 38, 36]; $hash{'number'}{'odd'} = [23, 43, 37, 35]; foreach my $i(keys %hash){ print $i; foreach my $j(keys %{$hash{$i}}){ print "\t".$j."\t"; print join(" ",@{$hash{'number'}{$j}})."\n"; } }
    furthermore thats offtopic :)
    $perlig =~ s/pec/cep/g if 'errors expected';