in reply to multi find/replace
my %changes = ( foo => 'bar', 2003 => 2004, cow => 'pig'); $string = 'foo 2003 cow cow 2003 foo whatever'; $string =~ s/(foo|2003|cow)/$changes{$1}/g; print $string; __END__ bar 2004 pig pig 2004 bar whatever
-enlil
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: multi find/replace
by jbware (Chaplain) on Feb 10, 2004 at 21:21 UTC | |
by mirod (Canon) on Feb 10, 2004 at 21:58 UTC |