in reply to Re: Count replaces in search and replace
in thread Count replaces in search and replace
One final comment - perhaps you should consider the += operator? As well, since you are visiting each key-value pair once, each might be appropriate. And, as long as you are using $_, you may way well use its shorthand.
my $YESMapping = 0; while (my ($key, $value) = each %map) { $YESMapping += s/$key/$value/gi; } print "Replaced $YESMapping entries.\n"
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Count replaces in search and replace
by VinsWorldcom (Prior) on Mar 13, 2009 at 01:32 UTC |