Home  |  Linux  | Mysql  | PHP  | XML
From:Harry Putnam Date:Tue Mar  9 02:18:13 2010
Subject:Re: good practice in File::Find
Harry Putnam <reader@newsguy.com> 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 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.

Oh crap... sorry.. I didn't really read what statement of mine you
were referencing there... and you point is well taken.

A moments thought would have told me as much.

My script does test for the directory name as well... hence my self
induced inability to ready your reply.

Navigate in group perl.beginners at sever nntp.perl.org
Previous Next


Your recent visits
Re: Any Good SCM tool to manage Perl Code locally
Re: Any Good SCM tool to manage Perl Code locally In-Reply-To:
Re: How to add a last-modified field to a page header ???? ....
Re: 1-line text file with numbers, need to add to them
Re: stripped output from Net::SSH2



  
© No Copyright
You are free to use Anything, but please consult your advocate before doing so as this website
also list content from other sources which may be copyrighted.
Site Maintained by Zareef Ahmed
Powered By PHP Consultants