Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!mcnc!uvaarpa!mmdf From: bbs@hankel.rutgers.edu (Barry Schwartz) Newsgroups: comp.lang.perl Subject: Re: bug in R.E. ? Message-ID: <1991May11.204205.10055@uvaarpa.Virginia.EDU> Date: 11 May 91 20:42:05 GMT Sender: mmdf@uvaarpa.Virginia.EDU (Uvaarpa Mail System) Reply-To: Barry Schwartz Organization: The Internet Lines: 22 lwall@jpl-devvax.jpl.nasa.gov (Larry Wall) writes: ]This is a message from your shell, not from perl. Probably because you said: ] ]: @dirs = <$DIR[a-z]*>; ] ]This makes use of the shell to do globbing, which has its advantages and ]its disadvantages. You've just discovered the primary disadvantage--shells ]have arbitrary limits. ] ]When writing a program like this, it's better to use opendir() and readdir(). ]It won't run into the limits of the shell, and it runs faster too. I just want to make a pitch for readdir(). At first it would seem easier to use shell globbing, but using readdir is easy once you start using it, _plus it gives you the power of Perl regular expressions as your globbing mechanism_. That's saved me trouble on at least one occasion. -- Barry Schwartz bbs@hankel.rutgers.edu trashman@kb2ear.uucp