packetstormer has asked for the wisdom of the Perl Monks concerning the following question:
I understand the "for loop" fine. It is the next part that puzzles me. I know the format $itemlist[x] refers to position x in the array @itemlist but what does the $ItemList[$i][0] refer to? Basically, what is that $i doing in there! Thanksfor($i = 1; $i <= $ItemCount; $i+=1) { print "Item $i is $ItemList[$i][3]\n", " Name: $ItemList[$i][0]\n", " Amount: $ItemList[$i][1]\n", " Process: $ItemList[$i][2]\n\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Newbie: 'For loops'
by chrestomanci (Priest) on Nov 30, 2010 at 15:02 UTC | |
by Anonymous Monk on Nov 30, 2010 at 15:10 UTC | |
by packetstormer (Monk) on Nov 30, 2010 at 15:05 UTC | |
|
Re: Newbie: 'For loops'
by locked_user sundialsvc4 (Abbot) on Nov 30, 2010 at 16:32 UTC | |
|
Re: Newbie: 'For loops'
by jffry (Hermit) on Nov 30, 2010 at 15:37 UTC | |
|
Re: Newbie: 'For loops'
by Anonymous Monk on Nov 30, 2010 at 15:00 UTC |