PERL: Size of an array of an Array
Hey guys... here is the situation:
@list1 = ("one", "two", "three");
@list2 = ("myList2");
@fooList = ([@list2], [@list1]);
Basically what I want to do is walk down each array in
@fooList. For instance I want to read data from @list2,
element at a time, then @list1, but I want to be able to
add new arrays to @fooList at any time. So I don't know
the size of @fooList or any of the arrays ahead of time.
So I want it to work like this (though it doesn't :))
foreach $thing1 (@fooList)
foreach $currentThing ($fooList[$thing1]);
So what I would like to happen in this case is have it print out each
element in each list.
so output would be like:
I could use "for" loops but I would need to know the sizes of the arrays inside @foolist on the fly, and I couldn't figure out how to do that either..
Or I might just be crazy..
Thanks much for the help!
Man.. thats great! thanks so much..
I didn't realize you could reference like that..
|All times are GMT -5. The time now is 07:24 AM.|