my $counter = 0; foreach (@template) { $counter++ if s/$replacement/${prefix}-${counter}/; print; }
In reply to Re: Why a regexp won't increment the value of a variable
by JavaFan
in thread Why a regexp won't increment the value of a variable
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |