home *** CD-ROM | disk | FTP | other *** search
- 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
- From: rray@lookout.it.uswc.uswest.com (Randy J. Ray)
- Newsgroups: comp.lang.perl
- Subject: Re: Using $*, but pattern doesn't match
- Message-ID: <1992Aug27.162956.207@advtech.uswest.com>
- Date: 27 Aug 92 16:29:56 GMT
- References: <1992Aug25.181818.13613@advtech.uswest.com> <120@eiffel.eiffel.com> <1992Aug25.214517.555@news.eng.convex.com> <121@eiffel.eiffel.com>
- Sender: rray@snakepit (Randy J. Ray)
- Organization: US WEST Communications, Inc. -- Denver, CO
- Lines: 30
- Nntp-Posting-Host: snakepit.it.uswc.uswest.com
-
- In article <121@eiffel.eiffel.com>, ram@eiffel.com (Raphael Manfredi) writes:
- > Quoting tchrist@convex.COM (Tom Christiansen) from comp.lang.perl:
- > >From the keyboard of ram@eiffel.com (Raphael Manfredi):
- > >:You have to use [.\n] if you want to match anything.
- > >
- > >Sorry, [] is a nonmagical zone, so your dot is a literal.
- > >Often we use [^\0] to mean (just about) anything.
- >
- > Hmm... I meant (.|\n) obviously :-)
- >
-
- Well, about an hour or so after posting, it dawned on me that . would not match
- \n whether $* was set to 1 or not. Since what I was trying to extract was the
- argument list from a local(...) = @_; declaration, I used the pattern:
-
- ([\w\d\s\*\@\$%,]*)
-
- which will only match if the material inside is relatively close to a legal
- argument list. This, combined with surrounding logic, allow me to report errors
- if they pop up.
-
- Perl still looks like line-noise to me. But it's GOOD line noise...
-
- Randy
- --
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Randy J. Ray -- U S WEST IT/CSD rray@{lookout,uswat}.it.uswc.uswest.com
- I'd rather talk religion with Charles Manson than discuss ethics with Congress.
- -me Phone: (303)595-2852
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-