Oh, #@%$£"!
I admit defeat. A sort is probably not what the OP specified. One could build a full temporary hash in the map but that would be cheating as well (also relies on $a not been used for anything else before):
my %hash = map { /^([^-]*)-(.*)$/; exists $$a{$1}? (push(@{$$a{$1}},$2 +) and ()): ( $1=>$$a{$1}=[$2] ) } @CELLS;
So there is really no way around first declaring the hash and then filling it. What a pity!
In reply to Re^3: Generating Hash-of-List using map?
by hdb
in thread Generating Hash-of-List using map?
by cmv
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |