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
"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
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
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
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