The syntax is in the declaration you pasted in your email > multi sub comb(Regex:D $matcher, Str:D $input, $limit = Inf, Bool :$match)
The colon in "Bool :$match" makes it a named argument. Not sure where definitive docs are, decent starting point is https://docs.perl6.org/type/Signature#Positional_vs._named_arguments -y On Sun, Nov 10, 2019 at 11:18 PM Joseph Brenner <doom...@gmail.com> wrote: > Thanks, that form does what I want-- > > I don't see how I could've understood that from the docs, though. > For example, I don't see any place where the :match adverb is > mentioned for either the method or routine form of comb. > > > > On 11/10/19, Elizabeth Mattijsen <l...@dijkmat.nl> wrote: > > dd "foobar".comb(/./, :g, :match); > > (「f」 「o」 「o」 「b」 「a」 「r」) > > > >> On 10 Nov 2019, at 23:46, Joseph Brenner <doom...@gmail.com> wrote: > >> > >> Can someone give me an example of how to use the comb routine to > >> return a list of match objects? > >> > >> The documentation here: > >> > >> https://docs.perl6.org/type/Str#routine_comb > >> > >> Mentions a boolean option to get match objects: > >> > >>> If $matcher is a Regex, each Match object is > >>> converted to a Str, unless $match is set. > >> > >> I gather that I must be reading this signature > >> wrong somehow, I can't get it to work: > >> > >>> multi sub comb(Regex:D $matcher, Str:D $input, $limit = Inf, Bool > >>> :$match) > >> > >> I keep trying variations of things like this: > >> > >> my @hits = comb(m/$search_pattern/, $chunk, 100, True); > > >