File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -569,14 +569,14 @@ Captures can be nested, in which case they are numbered per level
569
569
= head2 Named captures
570
570
571
571
Instead of numbering captures, you can also give them names. The generic --
572
- and slightly verbose -- way of giving out names is like this:
572
+ and slightly verbose -- way of naming captures is like this:
573
573
574
574
if 'abc' ~~ / $<myname> = [ \w+ ] / {
575
575
say ~$<myname> # abc
576
576
}
577
577
578
578
The access to the named capture, C << $<myname> >> , is a shorthand for indexing
579
- the match object as a hash, so C < $/{ 'myname' } > or C << $/<myname> >> .
579
+ the match object as a hash, in other words: C < $/{ 'myname' } > or C << $/<myname> >> .
580
580
581
581
Coercing the match object to a hash gives you easy programmatic access to
582
582
all named captures:
You can’t perform that action at this time.
0 commit comments