perl iterate through directories

Viewed 18678

I'm trying to get the name of all directories in the specified path

I tried the following but that gives me every level down not just at the path i specified

find(\&dir_names, "C:\\mydata\\");
sub dir_names {
    print "$File::Find::dir\n" if(-f $File::Find::dir,'/');
}
4 Answers
Related