home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!usc!zaphod.mps.ohio-state.edu!sample.eng.ohio-state.edu!purdue!decwrl!autodesk!dansmith
- From: dansmith@Autodesk.COM (Daniel Smith)
- Newsgroups: comp.lang.perl
- Subject: Re: Perl-side globbing (was Re: Perl Shell...)
- Message-ID: <18153@autodesk.COM>
- Date: 16 Dec 92 23:26:08 GMT
- References: <18086@autodesk.COM> <1992Dec10.073900.16503@spillman.uucp> <BzBvo6.96G@sran230.sra.co.jp>
- Organization: Autodesk Inc., Sausalito CA, USA
- Lines: 28
-
- In <BzBvo6.96G@sran230.sra.co.jp> utashiro@sran230.sra.co.jp (Kazumasa Utashiro) writes:
-
- > For your interest, here is my shell wildcard to regexp
- > subroutine. This version works only for a filename (not a
- > path). I wonder you call this simple or complex :-)
-
- > sub wildcard {
- > local($_) = @_;
- > s#\\?.#$_ = $&; s/\\?([_0-9A-Za-z])/$1/ || /\\./ || s/[*]/.*/ ||
- > s/[|]/\$|^/ || tr/?{,}[]\-/.(|)[]\-/ || s/./\\$&/; $_;#ge;
- > length($_) ? "^$_\$" : undef;
- > }
-
- Geez! :-) I suppose a good thing I can point out about the shell
- that I posted is that it's good for interactively working out lines like
- that above (or did you get that one right the first time? [1]) I can have
- it running in one window, and bounce perlisms off of it, while working through
- a script in another... Thanks to the folks that sent me globbing ideas/code,
- I hope to integrate them into SoftList, making it a lot more useable.
-
- Daniel
-
- [1] if so, I bow and wave, and say "I'm not worthy!" a la Wayne's World
- --
- Daniel Smith, Autodesk, Sausalito, California, (415) 332-2344 x 2580
- Disclaimer: written by a highly caffeinated mammal
- dansmith@autodesk.com dansmith@well.sf.ca.us
-
-