Perl 5 version 8.0 documentation
readdir
- readdir DIRHANDLE
Returns the next directory entry for a directory opened by
opendir
. If used in list context, returns all the rest of the entries in the directory. If there are no more entries, returns an undefined value in scalar context or a null list in list context.If you're planning to filetest the return values out of a
readdir
, you'd better prepend the directory in question. Otherwise, because we didn'tchdir
there, it would have been testing the wrong file.