in reply to readdir missing one file
Your first call to readdir goes into "my $dir" and then gets discarded by the next call in the condition of the while loop.
opendir my $Tdir, "/path/to/anywhere" or die "Can't opendir '/path/to/anywhere': $!"; my $dir; while($dir = readdir($Tdir)){ print "$dir\n"; } closedir $Tdir;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: readdir missing one file
by true (Pilgrim) on Oct 17, 2008 at 16:00 UTC | |
by rev_1318 (Chaplain) on Oct 17, 2008 at 16:25 UTC | |
by mpeever (Friar) on Oct 17, 2008 at 17:08 UTC | |
by Illuminatus (Curate) on Oct 17, 2008 at 16:23 UTC | |
by blazar (Canon) on Oct 18, 2008 at 12:27 UTC | |
by ikegami (Patriarch) on Oct 17, 2008 at 17:05 UTC | |
by JavaFan (Canon) on Oct 17, 2008 at 17:26 UTC | |
by blazar (Canon) on Oct 18, 2008 at 12:18 UTC |