develooper Front page | perl.beginners | Postings from April 2010

Re: File::Find and top level directory

Thread Previous
Shlomi Fish
April 25, 2010 02:35
Re: File::Find and top level directory
Message ID:
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 :

In - see 
<< $result->full_components() >>.


	Shlomi Fish

Shlomi Fish
Best Introductory Programming Language -

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

Thread Previous Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About