Actually this (non-)behavior is consistent with most other iterators on Perl.
For instance modifying a foreach @array is discouraged and modifying a %hash would reset each . A normal filehandle is controlled by tell and seek (IIRC).
So the default is to consider the iterated data as immutable.
There is no generally accepted way to handle other case except leaving it to the programmer to work around it with extra constructs.
Besides how should "a new file" be defined? Another name? Another inode? Other content? Changed timestamp?
YMMV!
In reply to Re: The "readdir()" fails to detect files created after the call to "opendir()" (iterators)
by LanX
in thread The "readdir()" fails to detect files created after the call to "opendir()"
by thejasviv
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |