Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I have an array which is a function of a number and a word, like $a[1]{"blue"}. If it were two numbers, I could process it with
If it were one-dimensional, I could usefor $i (1..$n) { for $j (1..$n) { ...stuff about $a[$i][$j] } }
But if my outer loop isforeach (keys %a) { ...stuff about $a{$_} }
what syntax do I use to do a foreach over the second argument with the first held constant at $i???for $i (1..$n) { }
TIA; please also answer by email to phil.rennert@ioip.com
Edit by tye, add CODE and P tags
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Syntax for partly associative arrays
by Zaxo (Archbishop) on Sep 05, 2003 at 17:41 UTC | |
by fletcher_the_dog (Friar) on Sep 05, 2003 at 21:04 UTC | |
|
Re: Syntax for partly associative arrays
by shenme (Priest) on Sep 05, 2003 at 17:48 UTC | |
by Anonymous Monk on Sep 08, 2003 at 14:23 UTC | |
by Anonymous Monk on Sep 08, 2003 at 14:43 UTC |