in reply to Re: reading directories
in thread reading directories
There is no promise that the first two elements returned from a readdir are dot and dotdot, so this code is dangerously unportable. It might not even work on your own machine tomorrow.opendir(DIR, "/users/foo/"); @bar = readdir(DIR); closedir(DIR); for (1..2) {shift @bar;} #get rid of '.' and '..'
-- Randal L. Schwartz, Perl hacker
|
|---|