Perl Monk, Perl Meditation | |
PerlMonks |
Re: Iterate trough a series of foldersby Marshall (Canon) |
on Apr 04, 2016 at 18:13 UTC ( [id://1159533]=note: print w/replies, xml ) | Need Help?? |
readdir will return the directories without complete path. the "." and ".." are also returned just like if you did ls or dir under windows. "." is current dir, and ".." is previous directory. You need to filter those out. grep {!/^./ and -d $_}readdir; if you have "hidden directories that start with "." and you want them, then modify grep accordingly.
In Section
Seekers of Perl Wisdom
|
|