Re: good practice in File::Find

2010-03-09 Thread Harry Putnam
Harry Putnam writes: >> Or perhaps: >> >> return if $File::Find::dir !~ /$dir_rgx/; >> > > Thanks. > >>> or >>> Like I've done in he code below. Just let the dir_rgx be a selector >>> and not worry about pulling the next line immediately. >>> >>> I've thought about using `stat' to allow only d

Re: good practice in File::Find

2010-03-08 Thread Harry Putnam
"John W. Krahn" writes: >> Like: next if(! $File::Find::dir =~ /$dir_rgx/); > > No. Because you are inside a subroutine you have to use return: > > return unless $File::Find::dir =~ /$dir_rgx/; > > Or perhaps: > > return if $File::Find::dir !~ /$dir_rgx/; > Thanks. >> or >> Like I've don

Re: good practice in File::Find

2010-03-08 Thread John W. Krahn
Harry Putnam wrote: I want to know if doing something like what is in the code below would be expensive or for some other reason a bad choice. There is more code, that either feeds the `find()' function or further processes the results of the `find()' part. The code is not in finished form, or

Re: good practice in File::Find

2010-03-08 Thread Shawn H Corey
Harry Putnam wrote: > find( > sub { > ## if we have a directory name that matches > if($File::Find::dir =~ /$dir_rgx/){ > ## if that directory has files with all numeric names > if(/^\d+$/){ if( ! /\D/ ){ > ## Open the files and search for a regex in

Re: good practice in File::Find

2010-03-08 Thread Harry Putnam
Harry Putnam writes: > [...] > > find( > sub { > ## if we have a directory name that matches > if($File::Find::dir =~ /$dir_rgx/){ > ## if that directory has files with all numeric names > if(/^\d+$/){ > ## Open the files and search for a regex in

good practice in File::Find

2010-03-08 Thread Harry Putnam
I want to know if doing something like what is in the code below would be expensive or for some other reason a bad choice. There is more code, that either feeds the `find()' function or further processes the results of the `find()' part. The code is not in finished form, or tested, but more to s