Skip to content

Commit ac55e0b

Browse files
committed
Add section in 'traps' about $/ changing on every match.
See issue #1752
1 parent fc6af71 commit ac55e0b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

doc/Language/traps.pod6

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -743,6 +743,12 @@ say 42 ~~ / [ 42 || 0 ] | 4/; # OUTPUT: «「42」␤»
743743
The code above may seem like it is producing a wrong result, but the
744744
implementation is actually right.
745745
746+
=head2 C<$/> changes each time a regular expression is matched
747+
748+
Eash time a regular expression is matched against something, the special
749+
variable C<$/> holding the result L<Match object|/type/Match>
750+
is changed accordingly to the result of the match (that could also be C<Nil>).
751+
746752
=head1 Common Precedence Mistakes
747753
748754
=head2 Adverbs and Precedence

0 commit comments

Comments
 (0)