I generated an array called @category. And in @category, I've stored an items array, @items, which contains several item. This was accomplished by using
push (@category, @items);
-----------------------------
Now, I'd like to do a loop that goes through each @items array and manipulates the individual items within each @items array. I'm using the following code:
for (@category) {
@items = $_;
item1 = $item[1] + whatever....;
item2 = $item[2] + whatever...;
item3 = $item[3]; # and so on....
} # end for loop
But for some reason I don't get what I expect (i.e.- item3 does not correspond to item[3]). It especially goes crazy if one of the items within the @items array is empty.
PLEASE, SOMEONE HELP ME WITHIN THIS. I'M GETTING BALD PULLING MY HAIR OUT OF FRUSTRATION.
[This message has been edited by fordona (edited March 20, 1999).]
[This message has been edited by fordona (edited March 20, 1999).]
push (@category, @items);
-----------------------------
Now, I'd like to do a loop that goes through each @items array and manipulates the individual items within each @items array. I'm using the following code:
for (@category) {
@items = $_;
item1 = $item[1] + whatever....;
item2 = $item[2] + whatever...;
item3 = $item[3]; # and so on....
} # end for loop
But for some reason I don't get what I expect (i.e.- item3 does not correspond to item[3]). It especially goes crazy if one of the items within the @items array is empty.
PLEASE, SOMEONE HELP ME WITHIN THIS. I'M GETTING BALD PULLING MY HAIR OUT OF FRUSTRATION.
[This message has been edited by fordona (edited March 20, 1999).]
[This message has been edited by fordona (edited March 20, 1999).]