while ( ... ) { ... } continue { # Reset the position of the regex match so that it will restart # just after the start of this match. This is done inside continue{} # to safeguard itself against a next() that someone else might # add later. pos() = $-[0] + 1; }