Help for this page
my $lastpos = 0; while ($lastpos < length $_) { ... # substr $_, $lastpos, ($matches[$chosen] - $lastpos) # should yield the selected chunk between choosing a match and upda +ting $lastpos }