Something in my syntax isn't working (and I'm not seeing it!)
We're not seeing it either, if you don't show us! What exactly ARE you getting? When I added:
use strict; use warnings;
at the top of the program, and assigned a value to $total_recs (since I have no idea what value you are starting with):
my $total_recs = 123;
and changed for $i (@pages) to for my $i (@pages), I got the output:
Page 1 of <a href="http://www.example.com/page1.shtml">http://www.exam +ple.com/pa ge1.shtml</a><br> <a href="http://www.example.com/page2.shtml">http://www.example.com/pa +ge2.shtml< /a><br> <a href="http://www.example.com/page3.shtml">http://www.example.com/pa +ge3.shtml< /a><br> <a href="http://www.example.com/page4.shtml">http://www.example.com/pa +ge4.shtml< /a><br> <a href="http://www.example.com/page5.shtml">http://www.example.com/pa +ge5.shtml< /a><br> <a href="http://www.example.com/page6.shtml">http://www.example.com/pa +ge6.shtml< /a><br> <a href="http://www.example.com/page7.shtml">http://www.example.com/pa +ge7.shtml< /a><br> <a href="http://www.example.com/page8.shtml">http://www.example.com/pa +ge8.shtml< /a><br> <a href="http://www.example.com/page9.shtml">http://www.example.com/pa +ge9.shtml< /a><br> <a href="http://www.example.com/page10.shtml">http://www.example.com/p +age10.shtm l</a><br> <a href="http://www.example.com/page11.shtml">http://www.example.com/p +age11.shtm l</a><br> <a href="http://www.example.com/page12.shtml">http://www.example.com/p +age12.shtm l</a><br>
which looks fine to me. It's the output for each page from 1 to 12 (as 123 / 10 = 12.3).
Please explain exactly what YOU are getting, and why you think it's wrong.
In reply to Re: using pagecount variable in array?
by liverpole
in thread using pagecount variable in array?
by bobafifi
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |