You can use the following "continue to split" mechanism in a loop:
(my($token, $sep), $string) = split /PATTERN/, $string, 2;
This will load the matched string (the separator) into $sep, the stuff before that into $token, and the rest of the string right after the match, into the string, shortening it, ready for the next iteration — provided you have exactly one pair of capturing parens in the pattern.
It's almost identical in effect (bar the negative impact on the global speed of regexes) as using the special variables $`, $&, $' on a normal match, using the same pattern.
If you could have more capturing parens, you can do:
my($token, @sep) = split /PATTERN/, $string, 2;
$string = pop @sep;
leaving all the captured separators in @sep. |