in reply to Re: Replacing nth occurrence of string
in thread Replacing nth occurrence of string

When assembling regular expressions, beware: if $delimiter had any regex special characters, you would have to use \Q$delimiter\E in the assembled regex.
my $delimiter = '.'; my $nth = 3; my $regex = '^(' . ('.*\Q' . $delimiter . '\E') x $nth . ')';

--
[ e d @ h a l l e y . c c ]