$str =~ s{$pattern}{push @positions, pos $str; $substitution}eg
I never worked with pos so I don't know if that helps you.
In reply to Re^3: Global substitution and report
by moritz
in thread Global substitution and report
by Outaspace
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |