Path: utzoo!attcan!uunet!bfmny0!tneff From: tneff@bfmny0.UU.NET (Tom Neff) Newsgroups: comp.lang.perl Subject: Globbing Message-ID: <15209@bfmny0.UU.NET> Date: 27 Feb 90 18:11:03 GMT Reply-To: tneff@bfmny0.UU.NET (Tom Neff) Lines: 28 A quick thought -- globbing is too slow right now. If your system has CSH, even though you never use it in your life otherwise, Perl will spawn it to do globbing. If you forcibly turn off #define CSH, Perl then spawns a Bourne shell PIPE! ('echo %s | tr') I can see the 'echo' as a quick&dirty, but a tool as sophisticated as Perl loading 'tr'??? With do_trans() and so forth already coded? Yeccch. At minimum in the second case, Perl should take the output of 'echo' (which is internal to many Bourne shells) and do its own translate. Ideally, Perl should do its own globbing. There is enough globbing code out to there to "borrow" from, and Perl already has 'dirent'. Better yet, replace traditional metachar globbing (or supplement it) with Perl regexp globbing. @foo = ; Now the programmer has REAL power at his fingertips. (I chose ! for the default match delimiter above because the ordinary / is too likely to conflict with the path spec.) I should get off my duff and code this as a Perl function @foo = &REglob("/usr/tmp/id[0-9]{2,5}.$XVAL"); first for demonstration purposes -- unless Randal wants to take up the challenge. :-)