perleager has asked for the wisdom of the Perl Monks concerning the following question:

Hello
I making a member search hack for my site. Lets say I have 30 members so far and a member wants to search for all the existing members of my site. How can I make it so the search cgi file to show 10 members per page. Meaning for this situation it would have 3 pages total. The data for the member names is a DBM file.

Right now I'm assuming something like this
$a = 0; if ($b eq "10") { foreach $member @members { $a++; until ($a = 10) { print <<EOF; $member EOF if ($a eq "20") { last; }#until }#foreach } else { foreach $member @members { $a++ print <<EOF; $member EOF until ($a = 10) { last; $b = 10; } } }#foreach #else


This code I just whipped up but haven't tested it because I think I know what the outcome would be. I just put the code in to give you guys the idea i'm looking for. If this code is not the way to go please let me know. Also if this code would be the way and could work, then I know when I have around 200 members and a member wants to search through the whole entire DBM file, then it'll might take a while to produce any results.

Thank you,
David

Replies are listed 'Best First'.
Re: Search script, 10 per page
by merlyn (Sage) on Apr 28, 2001 at 19:32 UTC
Re: Search script, 10 per page
by epoptai (Curate) on Apr 28, 2001 at 22:39 UTC