http://qs321.pair.com?node_id=60587

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question: (cgi programming)

I am curious as to know how search engines for example Altavista can display results on multiple pages. From what I already know, this code will display results on the set number.
@results = $results; $results_to_Show = 10; for ($x=0; $x < $results_to_show; $++) { print "$results[$x]"; }
This is all that I know for now but, How can I display the next set of 10 results?

Also: How can I display results in this form: ' Result pages: 12345 next>> '

thanks for your support,

Originally posted as a Categorized Question.

Replies are listed 'Best First'.
Re: Search results on multiple pages.
by Coyote (Deacon) on Feb 24, 2001 at 05:21 UTC
    Check out HTML::Pager from your local CPAN mirror.

    From the HTML::Pager documentation:

    DESCRIPTION

    This module handles the paging of data coming from an arbitrary source and being displayed using HTML::Template and CGI.pm. It provides an interface to pages of data similar to many well-known sites, like altavista.digital.com or www.google.com.

    This module uses HTML::Template to do all its HTML generation. While it is possible to use this module without directly using HTML::Template, it's not very useful. Modification of the look-and-feel as well as the functionality of the resulting HTML should all be done through HTML::Template objects. Take a look at HTML::Template for more info.