Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: File glob question

by tmiklas (Hermit)
on Jun 03, 2002 at 21:37 UTC ( #171338=note: print w/replies, xml ) Need Help??


in reply to File glob question

Maybe I'm wrong, but I suppose that those 5 minutes are just to make a list of files in a direcotry. The speed of operation depends mostly on your filesystem speed (for example Linux ext2 is much slower than ReiserFS - even in beta-experimental version).
While you can do nothing to speed this up, you can do some work-around... At first I suggest to make list of those 4000 files and write it somewhere. Then you can try something like this:
#!/usr/bin/perl use strict; open (FH, "<files.list") || die "Can't find files.list: $!\n"; my @files = <FH>; close (FH); while (my $file = shift(@files)) { chomp ($file); open (FILE, "$file") || warn "Warning: can't open $file, skipping. +..\n"; while (<FILE>) { chomp; if (/\b($info)\s*\./) { print $_} ... } }
and so on... Anyway, I'm sure that other monks right here would find much better solution than mine :-)

Greetz, Tom.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2022-05-25 16:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (90 votes). Check out past polls.

    Notices?