Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

RE: 5 of 10?

by Maqs (Deacon)
on May 13, 2000 at 12:22 UTC ( #11415=note: print w/replies, xml ) Need Help??

in reply to 5 of 10?

The principal solution is to export the number of the last entry through post, i.e.: a href="myscript.cgi?entry=5"
Then you can use the following routine in your script:
if ($entry >=5) {my $backnum= $entry-5} else {my $backnum=0}; my $nextnum=$entry+5; while ($entry % 5) { #do your output stuff ; $entry++; if ($backnum) { print "<a href=\"myscript.cgi?$backnum\">Previous</ +a>"}; }; print "<a href=\"myscript.cgi?$nextnum\">Next</a>"}; #other stuff...
However, if you would not use CGI module at all, you may parse parameters as $ARGV[0]
You might make a check for the nnumber of entries not to make your Next link to the enmpy page.
With best regards

Replies are listed 'Best First'.
RE: RE: 5 of 10?
by mcwee (Pilgrim) on May 14, 2000 at 23:22 UTC
    Not to be a noodge, but isn't that get that pases data through the URL, not post?

    Either way, I'm all about using argv[0] for this sort of thing-- it works great for situations where you need to pass data but don't really need the functionality of a form, and I tend to botch it much less frequently than I botch get and post.


    The Autonomic Pilot

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://11415]
[ambrus]: choroba: heh heh... I have such a doc bug report somewhere. fixed by now.
[Corion]: Once upon a time I had automatic tests for checking the synopsis, but I stopped doing that because the setup was too fragile on CPAN testers for extracting code from the SYNOPSIS.

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (8)
As of 2017-02-27 12:08 GMT
Find Nodes?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?

    Results (383 votes). Check out past polls.