in reply to Processing directories (again) with File::Find
This will go through all subdirectories and search 1.* first, then 2.*, then 3.* and at last 4.* or whatever you defined as a $limit.use File::Find; my $limit= 4; # Whatever you prefer for ($name = 1; $name <= $limit; ++$name) { find(\&Wanted, $dir); }
Update... Made a mistakesub Wanted { # /$name\.*/; # NO! You want $name at the beginning!
If what is undef?if (/^$name\./) { # if undef {
# $name++; # return; # } else { open(FILE, $_); my @lines = <FILE>; # some processing missing here? } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Processing directories (again) with File::Find
by billie_t (Sexton) on Jun 16, 2003 at 07:22 UTC | |
by Skeeve (Parson) on Jun 16, 2003 at 07:30 UTC | |
by billie_t (Sexton) on Jun 17, 2003 at 03:51 UTC |