in reply to Replacing a specfied instance of a pattern in a string
my $instance = 3;
$string = s/fsih/--$instance?$&:'fish'/eg;
Electric eels were invented at the same time as electricity
Before electricity was invented, electric eels had to stun with gas
Results (376 votes). Check out past polls.