in reply to Count replaces in search and replace
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Count replaces in search and replace
by kennethk (Abbot) on Mar 12, 2009 at 15:42 UTC | |
by VinsWorldcom (Prior) on Mar 13, 2009 at 01:32 UTC |