in reply to Replace the nth occurence
my $count = 1; my $str = "a,b,c,d"; $str =~ s/((,.*?){$count}),/$1|/; print $str;
In Section
Seekers of Perl Wisdom
in reply to Replace the nth occurence
my $count = 1; my $str = "a,b,c,d"; $str =~ s/((,.*?){$count}),/$1|/; print $str;