Subject: | Documentation shows a bad example. |
In the Path::Class::Dir documentation you have the following example
(Last few lines in SYNOPSIS & $dir->next documentation)
# Iterate with Path::Class methods:
while (my $file = $dir->next) {
# $file is a Path::Class::File or Path::Class::Dir object
...
}
If there is a directory named "0" (zero), then that will prematurely
terminate the while loop, since $file will be 0. (which is false).
There probably should be a $dir->eof() (or something else of that name)
subroutine.
while ( ! $dir->eof() ) {
my $file = $dir->next();
}
-daniel