> > Hi all, > > I would like to read the files under a folder and subfolders. > > For example, > > I have 3 folders on top level > > F1, F2, F3 > > F1 has files and sub folders. Same goes to F2 and F3. > > Desired output will be written in file as following > > C:\F1 > C:\F1\F12 > C:\F1\F12\F13 > C:\F2 > C:\F2\F22 > Etc etc >
Put your directory listing routine in a sub and call
it recursively...like method:
listDir("top_of_tree");
sub listDir
{
my $root = shift;
readdir....$root
foreach(@list_of_contents)
{
if(-d $root . "/" . $_)
{
print $root . "/" . $_
listDir($root . "/" . $_)
}
}
} #listDir
-Lynn.
<<attachment: winmail.dat>>
