in reply to Re^3: readdir missing one file
in thread readdir missing one file

You'll stop iterating prematurely if you have a file named 0 (zero).
That hasn't been true for a very long time:
perl -MO=Deparse -e 'while ($f = readdir $h) {1;}' while (defined($f = readdir $h)) { '???'; } -e syntax OK

Replies are listed 'Best First'.
Re^5: readdir missing one file
by blazar (Canon) on Oct 18, 2008 at 12:18 UTC

    I personally believe that I've just discovered the second little bit of C<while> (being more) magic (than I already knew) in just a few days...

    --
    If you can't understand the incipit, then please check the IPB Campaign.