<?xml version="1.0" encoding="windows-1252"?>
<node id="1013726" title="Replace In a Single Line" created="2013-01-17 03:25:00" updated="2013-01-17 03:25:00">
<type id="115">
perlquestion</type>
<author id="940339">
anshumangoyal</author>
<data>
<field name="doctext">
I have a Variable

&lt;code&gt;
$var = "GoodMan"
&lt;/code&gt;

I want to replace "oo" and assign it to a variable $var2 in a single line.

With Multiple Lines I can do like this:

&lt;code&gt;
$var1 = $var;
$var1 =~ s/oo//gi;
&lt;/code&gt;

How to do this in a line, so that $var is not changed and $var1 get's changed variable.</field>
</data>
</node>
