Skip to content

Commit aa0d2ea

Browse files
committed
Forgot to mention * as the right arg of flipflop.
$a ff * (or any of the other flipflop ops) means that there is no stop condition. Once $a matches, the flipflop is always successful.
1 parent 64b148b commit aa0d2ea

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib/Language/operators.pod

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1163,6 +1163,13 @@ the first element is printed:
11631163
say $_ if /A/ ff /B/; # prints only "AB"
11641164
}
11651165
1166+
If you only want to test against a start condition, and have no stop condition,
1167+
C<*> can be used as the "stop" condition.
1168+
1169+
for <A B C D E> {
1170+
say $_ if /C/ ff *; # prints C, D, and E
1171+
}
1172+
11661173
For the sed-like version, which does I<not> try C<$_> on the stop condition
11671174
after succeeding on the start condition, see L<C<fff>>.
11681175

0 commit comments

Comments
 (0)