Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!decwrl!bacchus.pa.dec.com!vixie From: vixie@decwrl.dec.com (Paul A Vixie) Newsgroups: comp.lang.perl Subject: Re: getting closer Message-ID: Date: 27 Jun 90 20:46:20 GMT References: <8501@jpl-devvax.JPL.NASA.GOV> Sender: news@wrl.dec.com (News) Organization: DEC Western Research Lab Lines: 26 In-Reply-To: lwall@jpl-devvax.JPL.NASA.GOV's message of 26 Jun 90 23:14:10 GMT >> I could make it work with backslash, and it might even be reasonable, just >> to maintain the principle of least surprise. On the other hand, >> backslash-itis is something I try to avoid when possible. Which is why I >> went with the egrep notion of (|){} as metacharacters rather than >> \(\|\)\{\}, since the metacharacters actually occur rather more frequently >> than the literal counterparts. Yes, but since you went out of your way to make sure that most \W meta- characters meant their literal selves when backslashed (I refer you to: This makes it sim- ple to quote a string that you want to use for a pattern but that you are afraid might contain metacharacters. Simply quote all the non-alphanumeric characters: $pattern =~ s/(\W)/\\$1/g; ), it seems intuitively neccessary that for ALL \W metacharacters to mean their literal selves when backslashed. I know that's what *I* expected :-). Paul -- Paul Vixie DEC Western Research Lab Palo Alto, California ...!decwrl!vixie