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
In reply to Re: multi find/replace
by Enlil
in thread multi find/replace
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |