I have two arrays. The first contains a list of headings for a table. The second contains a list of names that would go under the headings from the first array. I have to print the first heading, print the first ten names, print the second heading, print the second set of ten names, and so on. Here is the code I have so far:
foreach $heading (@headings) { print $heading; for ($count == 0;$count < 10;$count++) { $name = shift(@names); print $name; } }
My problem is...it prints the first heading and first ten names fine...then it finishes printing all the headings with no names. Like it only goes through the 'for' loop once. Can someone explain what i'm doing wrong?
In reply to using two arrays to make a table by Bongo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |