Give the following code, is there anyway to
grab a subset of files within a directory?
If I use this code below on a directory containing
20,000 .xml files, it takes *forever* to process
and pegs the CPU.
Thank you :)
-P0w3rK!d
sub getFiles { my $strDir = shift; my @aryFiles = (); # add all .xml files if (opendir (MYFILEHANDLE, $strDir)) { @aryFiles = map { "$_" } grep { /.xml/i} readdir MYFILEHANDLE; } else { print "Error: Can't read $strDir: $!"); } close (MYFILEHANDLE); return @aryFiles; }
In reply to Filesystem: How to grab subset of directory structure by P0w3rK!d
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |