in reply to Re^4: Obtaining a list of files in a directory and subdirectory.
in thread Obtaining a list of files in a directory and subdirectory.

File::Find or File::Find::Rule will work for either files or directories. To follow toolic's example, all directories would be listed by the code:

use File::Find::Rule; my @files = File::Find::Rule->directory()->in( $directory );

See File::Find::Rule for proper usage.