in reply to Readdir against large number of files
I'd try to use glob in scalar context:
while (my $matchingFiles = glob("*.rtsd001")) { ... }
Though that doesn't seem to your real problem - in your current version you already have only one filename in memory each time.
I'd rather think your problem is @fileContents, which can hold the contents of an entire file. Instead of reading a file, selecting lines, storing those, and printing the result, you can just print them line by line:
while (<UNMODIFIED>) { /STRUC20/ and print MODIFIED $_; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Readdir against large number of files
by learningperl01 (Beadle) on Oct 28, 2009 at 17:58 UTC | |
by almut (Canon) on Oct 28, 2009 at 19:03 UTC | |
by moritz (Cardinal) on Oct 28, 2009 at 18:45 UTC |