[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Parenthesis problem



At 16:17 -0600 31-10-97, Mark Manning/Muniz Eng. wrote:
>String to look for>\(getByte
>String to insert>\(MLF_getByte

Just a quick guess without looking at the code.

You use the first string in a regex match m() and the second in a
substitution pattern s()? I'm also guessing that you don't do a quotemeta()
on the "string to look for" before you use it in an m() operator?

The paren is special in a regex so you need to escape it. If you just need
simple string matching just use a quotemeta() on the string before the m().
If you need regex matching you'll have to make sure you enter a valid Perl
regex at the "String to look for>" prompt; including backslashin the paren
as above.

The "String to insert>" string is probably being used on the right side of
a substitute operator; where parens are *not* special and should not be
escaped. I.e. you do *not* want to escape that paren, but rather insert
literal text.

To try it out you should try:
String to look for>\(getByte
String to insert>(MLF_getByte

# Terje Bless, Resident BOFH  <URL:http://www.tss.no/>
# TSS Ltd.                    <URL:phone:+4777684817>



***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch