opendir Tdir, "/path/to/anywhere"; my $dir = readdir(Tdir); while($dir = readdir(Tdir)){ print "$dir\n"; }close Tdir;