Help for this page
CHUNK: while ( ( my $pos = pos $sentence ) < length $sentence ) { ... } last CHUNK; }
my @split = split /($phrase1|$phrase2)/, $sentence; @phrases = @split[map { 2 * $_ + 1 } 0 .. ($#split - 1)/2];