in reply to Re^3: how to use the values of the first hash to be the keys for the second hash
in thread how to use the values of the first hash to be the keys for the second hash

Thank you philiprbrenan.

But for %h2, the keys are supposed to be values in %h1

i.e the keys for %h2 are:

1.1.1

1.1.2

1.1.3

1.2.1

1.2.2

1.2.3

For each of the key, e.g 1.1.1, it would have different values in %h2: e.g.:

1.1.1=> qw(3.3.1,3.3.2,3.3.3)

1.1.2=> qw(4.4.1, 4.4.2, 4.4.3)

1.1.3=> qw(5.5.1, 5.5.2, 5.5.3)

1.2.1=> qw(6.6.1, 6.6.2, 6.6.3)

1.2.2=> qw(7.7.1, 7.7.2, 7.7.3)

1.2.3=> qw(8.8.1, 8.8.2, 8.8.3)

so the end results i desire would be:

key1=>qw(3.3.1,3.3.2,3.3.3, 4.4.1, 4.4.2, 4.4.3, 5.5.1, 5.5.2, 5.5.3)

key2=>qw(6.6.1, 6.6.2, 6.6.3,7.7.1, 7.7.2, 7.7.3,8.8.1, 8.8.2, 8.8.3)

That is that the keys from %h1 will have values from %h2.

  • Comment on Re^4: how to use the values of the first hash to be the keys for the second hash