anshumangoyal has asked for the wisdom of the Perl Monks concerning the following question:
I have a Variable
I want to replace "oo" and assign it to a variable $var2 in a single line. With Multiple Lines I can do like this:$var = "GoodMan"
How to do this in a line, so that $var is not changed and $var1 get's changed variable.$var1 = $var; $var1 =~ s/oo//gi;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Replace In a Single Line
by tobyink (Canon) on Jan 17, 2013 at 08:33 UTC | |
Re: Replace In a Single Line
by 7stud (Deacon) on Jan 17, 2013 at 11:04 UTC |
Back to
Seekers of Perl Wisdom