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

In reply to Search script, 10 per page by perleager

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.