Why bother, actually, when it can just be a lazy list... Opendir and closedir are very oldschool, and can be retained for whatever technical detail they are needed, but in most modern code I think that:
for readdir($dir_name) { .say } should work as well. The act of opening a directory is something I never quite got... Even a directory with millions of entries is still peanuts in todays memory sizes, and if it does need to be iterated very carefully the old variants can still be around. readdir() returning a list doesn't have to be inefficient but it's easier to screw up with it and make it bloat. -- Yuval Kogman <[EMAIL PROTECTED]> http://nothingmuch.woobling.org 0xEBD27418
pgpNgghKAUJR3.pgp
Description: PGP signature