In scalar context, substitution returns the number of replacements, i.e.
$number = $_ =~ s/$replace/$map{$replace}/gi;
See the documentation on substitution.In reply to Re: Count replaces in search and replace
by kennethk
in thread Count replaces in search and replace
by VinsWorldcom
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |