in reply to Re: Re: Re: Reversing Hash
in thread Reversing Hash

Hi Dave
That doesn't work:
Your script gives me answer without any 'reduction' in rev_hash keys.
$rev_hash{1 20 3} = "key1"
$rev_hash{1 9 17} = "key4 key5"
$rev_hash{1 9 8} = "key3"
$rev_hash{1 30 4 7} = "key2"
Which doesn't reduce the keys to its minimum possible. I like to have keys "3" "1 17" "1 8" and "4" . so the answer should be
$rev_hash{3} = "key1"
$rev_hash{1 17} = "key4 key5"
$rev_hash{1 8} = "key3"
$rev_hash{4} = "key2"

Thanks
artist