See my comments at my other reply to you.

Replace the latter half of your "galleryprint.pl" script with something like this:

my $page = url_param('page'); $page ||= 1; my $first = ($page - 1) * 20; my $last = $first + 19; print "<table>\n"; my $counter = 0; for ( (grep defined, reverse keys %upload)[ $first .. $last ] ) { my ( $filename, $width, $height ) = split ( /::/, $upload{$_} ); print " <tr>" unless ( $counter % 5 ); print qq(<td width=120" height="120">), qq(<a href="$imagedir/$filename" target="new">), qq(<img src="$imagedir/$filename" height="100" width="100">) +, qq(</a></td>); unless ( ++$counter % 5 ) { print "</tr>\n"; } } print "</table>";
I renamed the variables $first and $last to avoid the ambiguity of $bottom and $top I.e. It wasn't easy to tell whether you meant "bottom of page" or "bottom of range" (The bottom of the page would be the top of the range.) Whereas, $first is unambiguous because it is both the first image on the page and the first index in the range. Likewise with $last.

-sauoq
"My two cents aren't worth a dime.";

In reply to Re: Re: mathematical equation by sauoq
in thread mathematical equation by Anonymous Monk

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.