home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.perl
- Path: sparky!uunet!sybus.sybus.com!myrddin!tct!chip
- From: chip@tct.com (Chip Salzenberg)
- Subject: Re: grep() vs. for(;;){} (was Re: In 5.0...)
- Message-ID: <2B2D238A.35CE@tct.com>
- Date: Tue, 15 Dec 1992 00:15:05 GMT
- References: <1992Dec14.043835.23009@reed.edu> <1992Dec14.161234.21332@news.eng.convex.com>
- Organization: TC Telemanagement, Clearwater, FL
- Lines: 15
-
- According to tchrist@convex.COM (Tom Christiansen):
- >Usually grep works like mapcar; you could this:
- >
- > grep (push(@retlist, /(\d+)/g), "asdf 23fjk4", "qwerty", "123 ")
-
- No, no... don't use grep in this case! It's just going to build a
- return value that you'll never use. Better in every way is:
-
- for ("asdf 23fjk4", "qwerty", "123 ") { push(@retlist, /(\d+)/g); }
-
- --
- Chip Salzenberg at Teltronics/TCT <chip@tct.com>, <73717.366@compuserve.com>
- "you make me want to break the laws of time and space / you make me
- want to eat pork / you make me want to staple bagles to my face /
- and remove them with a pitchfork" -- Weird Al Yankovic, "You Make Me"
-