Seems to me that no amount of seeking will let someone find the right file from 90,000. Perhaps you need to offer a different interface to the classical file manager. Let people search by date range or title, for example, or find some regularity in the data which will let you break the collection into chunks. But then you'd probably need a database for that too.

Anyway, perhaps the simplest paging mechanism would be just to pass the name of the file at the end of the previous list, rather than trying to carry numbers? Then you can use something like:

# $filename comes from input my $marker; $marker = readdir(DIR) while ($filename cmp $marker); print "$_: " . readdir(DIR) . "\n" for (1..10) ;

Which assumes an alphabetical list but should survive deletion of the marker file, at least.

updated to remove stupid mistake before anyone notices.


In reply to Re: A story of a Perl Monk and Problem by thpfft
in thread A story of a Perl Monk and Problem by lindex

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.