perlfunc
gods
<P>
readdir - get a directory from a directory handle
<P>
<HR>
<P>
readdir
<FONT SIZE=-1>DIRHANDLE</FONT>
<P>
<HR>
<P>
Returns the next directory entry for a directory opened by [perlfunc:opendir|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.
<P>
If you're planning to filetest the return values out of a [perlfunc:readdir|readdir()], you'd better prepend the directory in question. Otherwise, because we
didn't
[perlfunc:chdir|chdir()] there, it would have been testing the wrong file.
<P>
<PRE> opendir(DIR, $some_dir) || die "can't opendir $some_dir: $!";
@dots = grep { /^\./ && -f "$some_dir/$_" } readdir(DIR);
closedir DIR;
</PRE>
<HR>