Hi Everyone,
I am trying to use the File-List 0.3.1 module to get a directory listing of
a group of subdirectory's that contain a certain file. My problem is that I
don't know in advance the case of the file name. According to the doc's
File::List is supposed to take a regex argument for the find function. If I
run this piece of code it works for all the files in lower case and misses
any file in upper or mixed case (as expected).
#!c:\perl\bin\perl.exe
use File::List;
use File::Stat;
$dir = "c:/branches";
my $search = new File::List($dir);
my @files = @{ $search->find("file.ext") };
while ($p = <@files>) {
print "$p\n";
}
If I run this piece of code with the regex inserted to disregard the case
of the file name then I get no results or garbage results.
#!c:\perl\bin\perl.exe
use File::List;
use File::Stat;
$dir = "c:/branches";
my $search = new File::List($dir);
my @files = @{ $search->find(/file\.ext/i) };
while ($p = <@files>) {
print "$p\n";
}
I'm at a loss why this doesn't work. Anyone's input would be fine on why
this doesn't work or a better way of handling this problem. I wrote this
using File::Find and it works but takes way too long to run so I'm trying
to speed things up and File::List looks like a good way to go if I can get
it to work.
Thanks for the help,
Tony Bass
_______________________________________________
ActivePerl mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
- RE: File::List issue Tony Bass
- RE: File::List issue Tariq Dennison
- RE: File::List issue King, Jason G
