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

File::Find and top level directory

Thread Next
From:
Harry Putnam
Date:
April 24, 2010 12:01
Subject:
File::Find and top level directory
Message ID:
87d3xoisk7.fsf@newsguy.com
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. 


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About