The classic approach is using a typeglob (perldata) globbing (glob, I/O Operators), but a simpler approach would be using the combination of opendir, readdir, and closedir to get the contents of a directory. You could also determine which of those entries are directories using the -d file test.