my $instance = 3; $string = s/fsih/--$instance?$&:'fish'/eg;
In reply to Re: Replacing a specfied instance of a pattern in a string
by Jasper
in thread Replacing a specfied instance of a pattern in a string
by krisahoch
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |