in reply to quick way to read a few directory entries of many

How often do the files in the directory change?

If it is not very often, you could run a cron job to put the list of files or a subset of the list of files into a separate file, then obtain your 5 file names from that.

  • Comment on Re: quick way to read a few directory entries of many

Replies are listed 'Best First'.
Re^2: quick way to read a few directory entries of many
by leocharre (Priest) on Jun 05, 2008 at 18:23 UTC

    This is a very good hack. Using Cache::File would be useful with that.

    Still there could be a few lines of code that could help speed this up, live.

    In my case, the files change often. I guess some caching is in order- or some kind of shared memory thing- a singleton, who knows- that would hold a list readily altered.. hmm.. Still looking for a small hack though..