packetstormer has asked for the wisdom of the Perl Monks concerning the following question:
Hello Monks
I am having trouble getting my head around this one!. I have a hash like below. Each hash value is a string seperated by a "|". I need to ignore the first value (as that is the hash key) but take the next two values e.g "RED DOOR|10-14" (one for each unique string) and then push the first value into an arrayref as the value! (eyes are bleeding writing this!) so the results might be:
"RED DOOR|10-14" => [5030,1049,4990,959......] "FLOWER|13+" => [15047,17665,17668...] "FLOWER|11+" => [15037....]
5030 => 5030|RED DOOR|10-14 1049 => 1049|RED DOOR|10-14 4990 => 4990|RED DOOR|10-14 959 => 959|RED DOOR|10-14 15047 => 15047|FLOWER|13+ 5565 => 5565|RED DOOR|10-14 4449 => 4449|RED DOOR|10-14 1065 => 1065|RED DOOR|10-14 2992 => 2992|RED DOOR|10-14 4956 => 4956|RED DOOR|10-14 17665 => 17665|FLOWER|13+ 6217 => 6217|RED DOOR|10-14 1224 => 1224|RED DOOR|10-14 424 => 424|RED DOOR|10-14 368 => 368|RED DOOR|10-14 451 => 451|RED DOOR|10-14 7752 => 7752|RED DOOR|10-14 4070 => 4070|RED DOOR|10-14 1312 => 1312|RED DOOR|10-14 17668 => 17668|FLOWER|13+ 4224 => 4224|RED DOOR|10-14 3588 => 3588|RED DOOR|10-14 11076 => 11076|RED DOOR|10-14 2986 => 2986|RED DOOR|10-14 2402 => 2402|RED DOOR|10-14 10834 => 10834|RED DOOR|10-14 849 => 849|RED DOOR|10-14 2954 => 2954|RED DOOR|10-14 11 => 11|RED DOOR|10-14 4093 => 4093|RED DOOR|10-14 492 => 492|RED DOOR|10-14 1861 => 1861|RED DOOR|10-14 4384 => 4384|RED DOOR|10-14 15037 => 15037|FLOWER|11+ 13044 => 13044|FLOWER|13+ 899 => 899|RED DOOR|10-14 292 => 292|RED DOOR|10-14 10421 => 10421|RED DOOR|10-14 4120 => 4120|RED DOOR|10-14 5557 => 5557|RED DOOR|10-14 3859 => 3859|RED DOOR|10-14 930 => 930|RED DOOR|10-14 649 => 649|RED DOOR|10-14 7511 => 7511|RED DOOR|10-14 648 => 648|RED DOOR|10-14 73 => 73|RED DOOR|10-14 12537 => 12537|RED DOOR|10-14 2485 => 2485|RED DOOR|10-14
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Counting Hash values?
by toolic (Bishop) on Mar 12, 2013 at 17:42 UTC | |
by packetstormer (Monk) on Mar 12, 2013 at 17:47 UTC | |
|
Re: Counting Hash values?
by thundergnat (Deacon) on Mar 12, 2013 at 17:38 UTC | |
|
Re: Counting Hash values?
by blue_cowdawg (Monsignor) on Mar 12, 2013 at 17:45 UTC | |
|
Re: Counting Hash values?
by Kenosis (Priest) on Mar 12, 2013 at 18:19 UTC | |
|
Re: Counting Hash values?
by denishowe (Acolyte) on Mar 12, 2013 at 17:45 UTC | |
|
Re: Counting Hash values?
by kcott (Archbishop) on Mar 12, 2013 at 22:31 UTC |