On Saturday 24 Apr 2010 22:00:56 Harry Putnam wrote:
> When using File::Find;
> Is there any built in way to know when you are in the top level of one
> of the directories in @directories?
> 
> I mean besides grepping $File::Find::dir.
> 
> I know that give the current directory name and of course the top
> directory could be massages out with something like:
> 
>    my ($tdir) = $File::Find::dir =~  m/^\.\/([^\/]+)/;
> 
> I didn't notice anything in perldoc File::Find, that seemed relevant
> so I'm guessing there is not any better way to know what is the top
> level of currently recursed directory.

There isn't one as far as I know. Touting my own horn, I should note that 
there is an easy way to do it in File-Find-Object :

http://www.shlomifish.org/open-source/projects/File-Find-Object/

In http://search.cpan.org/perldoc?File::Find::Object::Result - see 
<< $result->full_components() >>.

Regards,

        Shlomi Fish

-- 
-----------------------------------------------------------------
Shlomi Fish       http://www.shlomifish.org/
Best Introductory Programming Language - http://shlom.in/intro-lang

Deletionists delete Wikipedia articles that they consider lame.
Chuck Norris deletes deletionists whom he considers lame.

Please reply to list if it's a mailing list post - http://shlom.in/reply .

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