Theo Van Dinter wrote:
On Wed, Oct 25, 2006 at 12:57:52PM -0400, Joe Flowers wrote:
I'd prefer to use M::SA->check_message_text(), but if I do a M::SA->check_message_text('This is a programmer's nightmare.'), then M::SA->check_message_text() will choke because of the (') in the middle of the string. How do I properly get around this problem?

You can use any quoting mechanism you like:

...("This is a programmer's ...")
...([EMAIL PROTECTED] is a programmer's ...@)
etc.



Sorry for the Perl question.
Is the "q" in "([EMAIL PROTECTED] is a programmer's ...@)" a typo?


Also, M::SA->check_message_text('This too\') is a problem too because of
[...]
Any ideas on the best way to handle this?

Well, SA won't help you with general Perl quoting, just so we're clear this
isn't SA specific.  You could read the string into a variable then pass the
variable, or use one of the above methods, or something like:
$variable = <<EOF;
This is a programmer's ...
blah
foo bar
EOF
...check_message_text($variable);


I'm embedding this is C, so I have a level of C string escaping I have to deal with too, besides not being a Perl programmer.
And, that's the crux of the original problem and question.

Joe




Reply via email to