Using the line:
$_ =~ s/$replace/$map{$replace}/gi
to find $replace and replace it with the hash value of $map{$replace} case insensitive and all occurances on the given line works a treat.
However, I'd like to know 'how many' replacements were done on each line. Is there an easy way to get this value that I can increment in a counter to spit out at the end of the program that would say something like "Found and replaced X items"?
In reply to Count replaces in search and replace by VinsWorldcom
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |