You're mistaking the cause for your error. In fact, the code you posted will run AS-IS if you simply assign a value to $total_recs at the start of the script, and use POSIX qw/ceil/;. Though it's wise beyond words to learn to use strict;, and smart to use lexical variables such as my $i, the change you made by adding my $i to your foreach loop can't be what fixed the code you posted. The code you posted essentially works.
So what exactly was the error you were getting?
Dave
In reply to Re^3: using pagecount variable in array?
by davido
in thread using pagecount variable in array?
by bobafifi
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |