Thanks, the final solution I went with is:
my $YESMapping = 0; foreach my $replace (keys(%map)) { $YESMapping = $YESMapping + ($_ =~ s/$replace/$map{$replace}/gi) } print "Replaced $YESMapping entries.\n"
I did some reading on regex compiling and I'm looking at how to maybe apply that to the $replace variable which is obviously my loop index.
In reply to Re: Count replaces in search and replace
by VinsWorldcom
in thread Count replaces in search and replace
by VinsWorldcom
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |