On Fri, 2009-01-16 at 10:56 -0800, Blue wrote: > $string = "aaa ' ccc "; > $string =~ s/'/bbb/eg; > > The above replaces the single-quotation mark with bbb. The result will > be: > aaa bbb ccc > > How do I modify it so that the single-quotation mark is replaced with > \' (a backslash and a single-quotation mark) resulting in: > aaa \' ccc > >
See `perldoc perlre` and search for /\\Q/ -- Just my 0.00000002 million dollars worth, Shawn Programming is as much about organization and communication as it is about coding. "It would appear that we have reached the limits of what it is possible to achieve with computer technology, although one should be careful with such statements, as they tend to sound pretty silly in 5 years." --John von Neumann, circa 1950 -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/