Hi bobafifi,

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.


s''(q.S:$/9=(T1';s;(..)(..);$..=substr+crypt($1,$2),2,3;eg;print$..$/

In reply to Re: using pagecount variable in array? by liverpole
in thread using pagecount variable in array? by bobafifi

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.