"John W. Krahn" <jwkr...@shaw.ca> 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 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 directories into the
>> first directory based test as a further way to help focus things.  But
>> not sure any of this will help speed things up.
>
> $File::Find::dir will *only* contain directory names so such a test is
> not needed.

This isn't the kind of test I meant.  I'm talking about testing to see
if the directory matches a regex of directories to search.


-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to