in reply to multidimensional dilemma
$resultsByCode will be easiest to populate for numeric keys:
but the other way is not much more difficult:$resultsByCode{$_}++ for @resultStatus;
I'd recommend perldata, and perlsyn, and the Tutorials section here, because you show some confusion about hashes and arrays.$resultsByCode{$resultStatusCodes{$_}}++ for @resultStatus;
Update: Ahh.. misunderstood, minor modification to get what you want. I don't know where your id numbers really come from, so I'll do like your example and number them from 1 up:
That beats grep because it's only one pass through the data.push @{$resultsByCode{$resultStatus[$_]}},$_+1 for 0..$#resultStatus;
After Compline,
Zaxo
|
|---|