[Omaha.pm] Help with File::Find

Andy Lester andy at petdance.com
Wed Nov 5 16:06:22 PST 2008


On Nov 5, 2008, at 3:50 PM, Mike Hostetler wrote:

> sub logFinder {
>   my $proc="pat"
>   my @files=();
>
>   sub wanted {
>      /^$proc.*/s
>        && push(@files,$File::File::name);
>    }
>
>   find(\&wanted ,$logdir);


First, there's no need to match /^$proc.*/, because it is the same as / 
^$proc/.

I think something is missing here.  Is wanted() inside of logFinder?   
Why?  Perl doesn't nest subs like that.

Can you show us an entire program?

xoa


--
Andy Lester => andy at petdance.com => www.petdance.com => AIM:petdance






More information about the Omaha-pm mailing list