Perl Programming/Keywords/readdir

From Wikibooks, open books for an open world
Jump to navigation Jump to search
Previous: read Keywords Next: readline

The readdir keyword[edit | edit source]

readdir is a function that returns the next directory entry that was opened by opendir. If used in a list context, the function returns all the rest of the entries in the directory. If there are no more entries, it returns the undef value in scalar context and the empty list in list context.

Syntax[edit | edit source]

  readdir DIRHANDLE
chdir closedir mkdir opendir readdir rewinddir rmdir seekdir telldir
Previous: read Keywords Next: readline