http://www.perlmonks.org?node_id=963345


in reply to Re^2: Looping and counting
in thread Looping and counting

Put this between your two for loops:

$main_list2 = '';

But seeing as you have have a $main_list2, why don't you use $main_list1 in the first for loop instead?

Also, probably want to have a "\n" between your titles:

$main_list2 .= "$title\n";