home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!uwm.edu!ogicse!reed!mjeffery
- From: mjeffery@reed.edu (Mark Jefferys)
- Newsgroups: comp.lang.perl
- Subject: Re: In 5.0, are we gonna get...
- Message-ID: <1992Dec15.051950.1679@reed.edu>
- Date: 15 Dec 92 05:19:50 GMT
- Article-I.D.: reed.1992Dec15.051950.1679
- References: <1992Dec14.043835.23009@reed.edu> <1992Dec14.161234.21332@news.eng.convex.com>
- Organization: Reed College, Portland, OR
- Lines: 28
-
- In article <1992Dec14.161234.21332@news.eng.convex.com> tchrist@convex.COM (Tom Christiansen) writes:
- % From the keyboard of mjeffery@reed.edu (Mark Jefferys):
-
- % :1) an equivalent of lisp's mapcar? For an instance:
- % :
- % : map(/(\d+)/, "asdf 23fjk4", "qwerty", "123 ")
- ^ forgot the `g'
- % :
- % : would return ("23", "4", "123").
-
- % I'd like to use
- %
- % grep(/(\d+)/g, "asdf 23fjk4", "qwerty", "123 ")
- %
- % but that doesn't work for two reasons:
- %
- % 1) i haven't been able to tickle grep's expr into an array context
- % 2) it returns the original elt, not the expr result
-
- That's why I want something like mapcar. I come across enough cases
- where I've wanted one, but had to write some ugly replacement. I
- thought about it awhile, and decided that it's the sort of thing that
- should be built-in.
-
-
- Mark
- --
- Mark Jefferys Internet: mjeffery@reed.edu
-