home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / lang / perl / 7409 < prev    next >
Encoding:
Text File  |  1992-12-14  |  1.6 KB  |  46 lines

  1. Newsgroups: comp.lang.perl
  2. Path: sparky!uunet!gatech!europa.asd.contel.com!darwin.sura.net!convex!convex!tchrist
  3. From: Tom Christiansen <tchrist@convex.COM>
  4. Subject: Re: In 5.0, are we gonna get...
  5. Originator: tchrist@pixel.convex.com
  6. Sender: usenet@news.eng.convex.com (news access account)
  7. Message-ID: <1992Dec14.161234.21332@news.eng.convex.com>
  8. Date: Mon, 14 Dec 1992 16:12:34 GMT
  9. Reply-To: tchrist@convex.COM (Tom Christiansen)
  10. References: <1992Dec14.043835.23009@reed.edu>
  11. Nntp-Posting-Host: pixel.convex.com
  12. Organization: Convex Computer Corporation, Colorado Springs, CO
  13. X-Disclaimer: This message was written by a user at CONVEX Computer
  14.               Corp. The opinions expressed are those of the user and
  15.               not necessarily those of CONVEX.
  16. Lines: 28
  17.  
  18. From the keyboard of mjeffery@reed.edu (Mark Jefferys):
  19. :Will we see:
  20. :
  21. :1) an equivalent of lisp's mapcar?  For an instance:
  22. :
  23. :    map(/(\d+)/, "asdf 23fjk4", "qwerty", "123 ")
  24. :
  25. :   would return ("23", "4", "123").
  26.  
  27. Usually grep works like mapcar; you could this:
  28.  
  29.     grep (push(@retlist, /(\d+)/g), "asdf 23fjk4", "qwerty", "123 ")
  30.  
  31. I'd like to use
  32.  
  33.     grep(/(\d+)/g, "asdf 23fjk4", "qwerty", "123 ")
  34.  
  35. but that doesn't work for two reasons:
  36.  
  37.     1) i haven't been able to tickle grep's expr into an array context
  38.     2) it returns the original elt, not the expr result
  39.  
  40. --tom
  41. -- 
  42.     Tom Christiansen      tchrist@convex.com      convex!tchrist
  43.     You know, by the time you get some with all this, the "Swiss Army
  44.     Chainsaw" is going to be more like a Swiss Army Tactical Nuke....  :-)
  45.         --Brandon Allbery on perl in <1991Feb21.002412.20045@NCoast.ORG>
  46.