Why does Perl's readdir() cache directory entries?
- by Frank Straetz
For some reason Perl keeps caching the directory entries I'm trying to read using readdir:
opendir(SNIPPETS, $dir_snippets); # or die...
while ( my $snippet = readdir(SNIPPETS) )
{ print ">>>".$snippet."\n"; }
closedir(SNIPPETS);
Since my directory contains two files, test.pl and test.man, I'm expecting the following output:
.
..…