in reply to RE: Re: Directory Listing
in thread Directory Listing

FWIW I avoid idioms like the above ever since I got bitten by the fact that globbing is a shell operation. Very few will notice, but I have been in the position of needing to do an emergency rewrite when I passed the maxium number of files in a directory that could be listed. (What that limit is depends on the shell Perl was built with. That time it was a bit over 3000.) While readdir() is much more verbose, with it I have no fears about being bitten again.

YMMV, warranty void where prohibited, etc.

UPDATE
jlp makes an excellent point below. I did not remember it, but once he said it I had a small bell go off. I had heard about that. Once 5.6.1 comes out I look forward to exploring what other goodness can be found therein.

Replies are listed 'Best First'.
RE: RE (3): Directory Listing
by jlp (Friar) on Aug 10, 2000 at 03:13 UTC
    "...I got bitten by the fact that globbing is a shell operation"

    This is true only in versions of perl prior to 5.6. In 5.6, globbing is implemented internally using File::Glob. My benchmarking shows glob() in 5.6 to be two orders of magnitude faster than in prior versions. Not only that, but it is also faster than the opendir(), readdir(), grep idiom. (yes, I am aware of your objections to 5.6, but I have yet to encounter any bugs, personally)