$i = 0; @no = qw(one two three four five); foreach ( @no ){ s/e/foo.$i/ && $i++ while /e/; } print "@no\n"; __END__ onfoo.0 two thrfoo.1foo.2 four fivfoo.3
--
perl -pe "s/\b;([st])/'\1/mg"
In reply to Re: Increase number per regex replacement
by belg4mit
in thread Increase number per regex replacement
by bittondb
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |