perl: find the index of the nth occurrence of a character in a string : I've found `index` and `rindex` for finding the first or last occurrence of a character (or substring) in a string.  I'm also aware that they have an `offset` that can be used to start at a certain index.

What I want to know is if there is a simple way to find the index `n`th occurrence of a character or substring in a string.  I'd prefer not to have to do it regex and would prefer not to have to write a loop that just repeatedly calls `index` with an offset.