home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / lang / perl / 5554 < prev    next >
Encoding:
Internet Message Format  |  1992-08-27  |  1.9 KB

  1. Path: sparky!uunet!dtix!darwin.sura.net!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!csn!cherokee!lookout.it.uswc.uswest.com!rray
  2. From: rray@lookout.it.uswc.uswest.com (Randy J. Ray)
  3. Newsgroups: comp.lang.perl
  4. Subject: Re: Using $*, but pattern doesn't match
  5. Message-ID: <1992Aug27.162956.207@advtech.uswest.com>
  6. Date: 27 Aug 92 16:29:56 GMT
  7. References: <1992Aug25.181818.13613@advtech.uswest.com> <120@eiffel.eiffel.com> <1992Aug25.214517.555@news.eng.convex.com> <121@eiffel.eiffel.com>
  8. Sender: rray@snakepit (Randy J. Ray)
  9. Organization: US WEST Communications, Inc. -- Denver, CO
  10. Lines: 30
  11. Nntp-Posting-Host: snakepit.it.uswc.uswest.com
  12.  
  13. In article <121@eiffel.eiffel.com>, ram@eiffel.com (Raphael Manfredi) writes:
  14. > Quoting tchrist@convex.COM (Tom Christiansen) from comp.lang.perl:
  15. > >From the keyboard of ram@eiffel.com (Raphael Manfredi):
  16. > >:You have to use [.\n] if you want to match anything.
  17. > >
  18. > >Sorry, [] is a nonmagical zone, so your dot is a literal.
  19. > >Often we use [^\0] to mean (just about) anything.
  20. > Hmm... I meant (.|\n) obviously :-)
  21.  
  22. Well, about an hour or so after posting, it dawned on me that . would not match
  23. \n whether $* was set to 1 or not. Since what I was trying to extract was the
  24. argument list from a local(...) = @_; declaration, I used the pattern:
  25.  
  26. ([\w\d\s\*\@\$%,]*)
  27.  
  28. which will only match if the material inside is relatively close to a legal
  29. argument list. This, combined with surrounding logic, allow me to report errors
  30. if they pop up.
  31.  
  32. Perl still looks like line-noise to me. But it's GOOD line noise...
  33.  
  34. Randy
  35. -- 
  36. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  37. Randy J. Ray -- U S WEST IT/CSD         rray@{lookout,uswat}.it.uswc.uswest.com
  38. I'd rather talk religion with Charles Manson than discuss ethics with Congress.
  39.      -me                                                   Phone: (303)595-2852
  40. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  41.