in reply to multidimensional dilemma

$resultsByCode will be easiest to populate for numeric keys:

$resultsByCode{$_}++ for @resultStatus;
but the other way is not much more difficult:
$resultsByCode{$resultStatusCodes{$_}}++ for @resultStatus;
I'd recommend perldata, and perlsyn, and the Tutorials section here, because you show some confusion about hashes and arrays.

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:

push @{$resultsByCode{$resultStatus[$_]}},$_+1 for 0..$#resultStatus;
That beats grep because it's only one pass through the data.

After Compline,
Zaxo