On Tue, Jul 31, 2018 at 09:28:08PM +0200, Marc Chantreux wrote: > @*ARGS.map: { > gather { > my @lines; > for .IO.lines -> $l { > if /'›'/ { > @lines and take @lines; > @lines = $l; > } > else { > @lines.push($l); > take @lines if /''/; > } > } > } > } > > this doesn't work as it seems that '›' and '' aren't matched.
Is it as simple that the /'›'/ regex is being matched against $_ instead of $l ? If I'm reading the above code correctly, $_ is being set to each of the values of @ARGS in turn. The lines iterated by the for loop are all being bound to $l, meaning $_ is unchanged from its outer (map) meaning. Pm