I was wondering if you could clear a few things up..

I need different equations depending on what page I'm on, so I devised

if ($page < 1) { for ( grep defined($_), ( reverse keys %upload )[ -19 .. 0 ] ) { } elsif ($page eq 2) { my $top = ($page * 20); my $bottom = $top - 19; } else ($page > 2) { my $top = $page * 20; my $bottom = $top - 19; }
On the first if statement, it's printing incorrectly. It's printing images 4, 3, 2, 1, 2 instead of just 4, 3, 2, 1. It must be pulling a range that's to be used with one of the other loops, have any idea how? Because ?page=2 returns images 1, 2, 10, 9... (one of these two aren't supposed to be pulling the 1, 2 but I can't figure out which one).

All pages=3 and up are working properly, it's just page 1 and two which are sharing the same pictures. (When I say picture numbers, it just means I uploaded test images with numbers on them so I could see which order they went in).

I'm using something like that module you said. Any ideas on what part of the equations is wrong?


In reply to Re: Re: mathematical equation by Anonymous Monk
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.