nmerriweather has asked for the wisdom of the Perl Monks concerning the following question:
i've been assigning hashes relating to users 'result status' var, that has one of those numbers. that works all fine.%ResultStatusCodes = ( 1 => "registered", 2 => "unregistered", 3 => "waiting" )
which would mean record 1 ($resultStatus1) is 1. simple enough.$resultStatus[1] = 1;
or%ResultsByCode = ( registered => @ of registered ids unregistered => @ of unregistered ids waiting => @ 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 = ( 1 = @ of registered ids 2 = @ of unregistered ids 3 = @ of waiting ids )
@resultsByCode = (); for ($i=1;$i<=5;$i++){ $resultsByCode[$i] = ();} for ($i=1;$i<=5;$i++){ push $resultsByCode[$resultStatus{$i}], $i; }
push "resultsByCodecode1 = registered" , record id%resultsByCode = (); for ($i=1;$i<=5;$i++){ push $resultsByCode{$resultStatus{$i}}, $i; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: multidimensional dilemma
by Russ (Deacon) on Jun 04, 2002 at 00:40 UTC | |
|
Re: multidimensional dilemma
by Zaxo (Archbishop) on Jun 04, 2002 at 01:11 UTC | |
|
Re: multidimensional dilemma
by DelRode (Initiate) on Jun 04, 2002 at 03:12 UTC | |
|
Re: multidimensional dilemma
by nmerriweather (Friar) on Jun 04, 2002 at 04:41 UTC | |
by nmerriweather (Friar) on Jun 04, 2002 at 05:31 UTC | |
|
Re: multidimensional dilemma
by nmerriweather (Friar) on Jun 04, 2002 at 02:20 UTC | |
|
Re: multidimensional dilemma
by nmerriweather (Friar) on Jun 04, 2002 at 03:03 UTC |