this is a simple question -- but i've spent an hour on it w/no luck, and can't seem to find an answer anywhere
right now, i've got a hash
%ResultStatusCodes = (
1 => "registered",
2 => "unregistered",
3 => "waiting"
)
i've been assigning hashes relating to users 'result status' var, that has one of those numbers. that works all fine.
$resultStatus[1] = 1;
which would mean record 1 ($resultStatus
1) is 1. simple enough.
now, i need to seperate theses records by their 'resultStatus'
%ResultsByCode = (
registered => @ of registered ids
unregistered => @ of unregistered ids
waiting => @ of waiting ids
)
or
@ResultsByCode = (
1 = @ of registered ids
2 = @ of unregistered ids
3 = @ of waiting ids
)
problem is -- i can't figure out how to do this. i think it should look something like this, though i know none are right
@resultsByCode = ();
for ($i=1;$i<=5;$i++){ $resultsByCode[$i] = ();}
for ($i=1;$i<=5;$i++){
push $resultsByCode[$resultStatus{$i}], $i;
}
%resultsByCode = ();
for ($i=1;$i<=5;$i++){
push $resultsByCode{$resultStatus{$i}}, $i;
}
push "resultsByCode
code1 = registered" , record id
i'm at a loss. can someone point me in the right direction?