=over =item readdir DIRHANDLE X Returns the next directory entry for a directory opened by C. If used in list context, returns all the rest of the entries in the directory. If there are no more entries, returns the undefined value in scalar context and the empty list in list context. If you're planning to filetest the return values out of a C, you'd better prepend the directory in question. Otherwise, because we didn't C there, it would have been testing the wrong file. opendir(my $dh, $some_dir) || die "can't opendir $some_dir: $!"; @dots = grep { /^\./ && -f "$some_dir/$_" } readdir($dh); closedir $dh; As of Perl 5.11.2 you can use a bare C in a C loop, which will set C<$_> on every iteration. opendir(my $dh, $some_dir) || die; while(readdir $dh) { print "$some_dir/$_\n"; } closedir $dh; =back