Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Searching over multiple directories using unusual logic

by shmem (Chancellor)
on Oct 27, 2015 at 20:25 UTC ( [id://1146172]=note: print w/replies, xml ) Need Help??


in reply to Searching over multiple directories using unusual logic

I don't know your environment, so it is difficult to advocate improvement, or something else. It all depends on where your program is spending too much time, if you are concerned about that. It depends on the number of updates to the searched directories, the timespan searched through, upon the number of files in each, and the size of the files searched. And it all depends on Laziness, Impatience and Hubris.

Off my head, some things to look at:

  • you could delegate the file search to the Findutils suite, running updatedb in reasonable intervals, building a query for locate and filter the list the shelled out locate returns (impatience)
  • you could - depending on the file size - either use grep or perl to search through the files (impatience)
  • have a look at ack for inspiration, if you are going to satisfy your hubris

For laziness - "if it ain't broke, don't fix it" and if there are no complaints - just let the working solution in place.

Hopefully others can provide more ideas...

perl -le'print map{pack c,($-++?1:13)+ord}split//,ESEL'

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1146172]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2024-04-16 21:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found