in reply to Don't use opendir
in thread thanks, i'm new. rtfm right? :)

<*> (file globbing) used to spawn a csh process (and used to do some other horrible thing on Windows), but now (as of 5.6?) uses File::Glob. I still avoid it, because (open|read|close)dir with grep provides better file and pattern matching capabilities. And maybe I just find the syntax ambiguous (I confuse it with reading lines of a filehandle), which is maybe just my own prejudice. I'm curious as to what others think of file globbing vs. readdir...

Replies are listed 'Best First'.
RE: RE: Don't use opendir
by merlyn (Sage) on Oct 25, 2000 at 21:57 UTC
RE (tilly) 2: Don't use opendir
by tilly (Archbishop) on Oct 26, 2000 at 07:02 UTC
    Absolutely. I was seriously burned once on an older Perl with scripts that used globbing which began returning nothing when the directory got too many files. *THAT* was a fun one to debug, and I am not a great fan of rewriting production jobs on the fly. :-(

    Even with File::Glob I would avoid globbing if there was going to be any possibilities of filenames with spaces or wildcards in them. The semantics of readdir etc are safe with meta-characters. The sematics of globbing are very troublesome.