CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Intermediate:



Aug 14, 2001, 12:18 AM

Post #1 of 2 (674 views)
cgi/perl Can't Post

Search results can span several Web pages. Results are displayed in groups of 10 per page with the total number of results displayed near the top of the page. When there are multiple pages of results, links to the additional pages appear at the bottom of each page.
if my results is sort in an associative arrary, how can I display it in the situation above

User / Moderator

Aug 14, 2001, 4:33 AM

Post #2 of 2 (670 views)
Re: cgi/perl [In reply to] Can't Post


First, do not count on data being sorted in an associated array (HASH). The only way to count on the sort is to put the keys into an array and then sort that array like this (assume %results is filled with search results):

my @sortedKeys = sort keys %results;

Now, in form to submit to get the next set of results (whether or not you are using hyperlinks or a submit button) you probably could put some hidden form elements with the values of the first displayed item and the last displayed item so you know which elements to display next. This is standard pagination logic. Get some books with CGI/Perl examples for search engines and these issues are usually addressed.



$a="c323745335d3221214b364d545a362532582521254c3640504c37292f493759214b3635554c3040606a0",print unpack"u*",pack "h*",$a,"\n\n"


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives