Document :my and :our within regex blocks #1475
Labels
docs
Documentation issue (primary issue type)
good first issue
If you want to dive in, this would be a good place to start
update
part of "docs" - indicates this is an update for an existing section; rewrite, clarification, etc.
:my
and:our
usage within regexes is not documented. For:my
, something like this would be nice::my $foo = 0
is needed to declare a variable that has scope throughout and beyond the regex body, unlike variables declared in blocks. For example, the following trivial example shows a counter used for debugging:$paragraph ~~ rx| :my $counter = 0; ( \V* { ++$counter } ) *%% \n |; say "Matched $counter lines";
If that's too verbose, a sentence or two could be added to the example that uses
:my
(but doesn't explain it).The text was updated successfully, but these errors were encountered: