in reply to Minimize Hash Key Value Combinations
If the Keys are very small, yet the values are large strings, why not put the string values in an array, then store the array indices under your keys?
my @big_strings = ( 'War and peace', 'The Lord of the rings', 'PI, to plenty of decimal places', ); my %keys = ( # give index into big_strings [a, b, c] => [1, 2], [b, d] => [0, 2], );
your use of something looking like lists, for 'keys' troubles me somewhat. What are you actually trying to achieve here? Is this perhaps an X-Y problem? When you walk up to your hash with a 'key' will that key be 'a' or a list a,c,g ?
Cheers,
R.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Minimize Hash Key Value Combinations
by AlexTape (Monk) on Nov 18, 2013 at 14:41 UTC | |
by Anonymous Monk on Nov 18, 2013 at 16:48 UTC | |
by AlexTape (Monk) on Nov 18, 2013 at 16:59 UTC |