On Thursday, June 20, 2002, at 03:03 , Auernheimer, Rebecca (CORP,
Consultant) wrote:
[..]
> my @filelist = grep { $_ ne -d && m/^\d\d\d(\d|\d\d)\d$/ }, readdir DIR;
>
another close but no cigar you might try
my @filelist = grep { /^\d{5,6}$/ && -f "$baseDir/$_" } readdir DIR ;
The basic illustration comes from the
perldoc -f readdir
the regEx from the
perldoc perlre
{ and some experience }
> but then I would get this error:
>
> syntax error at C:\perl\practice\test.pl line 5, near "},"
> Execution of C:\perl\practice\test.pl aborted due to compilation errors.
the ',' was a part of the crisis there....
> How do I get that directory out of my array? I would welcome any
> suggestions/critique.
cf:
http://www.wetware.com/drieux/pbl/perlTrick/readDirProblem.txt
Ok, so I have a /tmp/drieux directory I keep around to play
in and your mileage may vary with getting that to play in WIN32...
but the core is what you want...
ciao
drieux
---
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]