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"
In reply to Re^2: Count replaces in search and replace
by kennethk
in thread Count replaces in search and replace
by VinsWorldcom
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |