sub finddir { my $root = shift; chomp ( $root ); $root = $root . '/' unless ( $root =~ m|/$| ); local *DIR; opendir ( DIR, $root ); while ( defined(my $file = readdir( DIR )) ) { next unless ( -d $root . $file ); next if ( $file eq '.' ); next if ( $file eq '..' ); print $root . $file, "\n"; finddir( $root . $file ); } }
Update Fixed two bugs.
In reply to Re: Getting all the direcotories
by ehdonhon
in thread Getting all the directories
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |