On Nov 17, 2003, at 4:18 PM, Eric Walker wrote:

I have the following code to find a quote in a string and replace it
with a slashquote.

ie " goes to \"

How do I get it to do more than one substitution in the string.

The /g modifier, for "global".


$_ = $$Rules{$yes}{rule_desc};
s/"/\\"/;
$$Rules{$yes}{rule_desc} = $_;

Let's clean that up a little. We don't need $_ here.


$$Rules{$yes}{rule_desc} =~ s/"/\\"/g;

How's that?

James


-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to