in reply to Multiplication table

Wow, that's a lot of output and next to no description of your problem. But I think you are trying to print out multiplication tables. You almost have it, however, your problem is that you are incrementing both of your counters simultaneously. In fact $counter and $counting are incremented one after the other. That leads to your problem where you get 0*1, then 1*2, etc. What you want is a nested loop. That is for each $counter, you want to iterate through $counting 10 times to print out the times table for that number, then print the newline, increment $counter, and continue. Here's a basic example with for loops(They're your friend)

for my $x (1..$howmany) { print "#"; for my $y (1..10) { my $answer = $x * $y; print "|$x|*|$y|=|$answer"; } print "\n"; }

Notice how one for loop is nested in the other, so for every iteration of $x which goes from 1 through $howmany, you get 10 iterations of $y. performing the math and printing inside the second for loop and you are done. No fuss, no muss, and no tracking of several counter variables.

HTH