You can also use a whatever star with the subst method to avoid the block
entirely, and just chain method calls:

my @fields = $line.split( ',' ).map: *.subst(/\'/, "", :g).subst(/^\"|\"$/,
"", :g);


On Wed, Sep 20, 2017 at 11:37 PM, Luca Ferrari <fluca1...@infinito.it>
wrote:

> On Tue, Sep 19, 2017 at 2:43 PM, Timo Paulssen <t...@wakelift.de> wrote:
> >     perl6 -e '.perl.say for "hello, how, are, you".split(",").map: -> $_
> > is copy { s:g/a//; s:g/^ \s|\s $/O/; $_ }'
> >     "hello"
> >     "Ohow"
> >     "Ore"
> >     "Oyou"
>
> Thanks.
> Out of cursiosity: what is the diffence between using "is copy" and "<->"?
> Seems to me the map example can work with both.
>
> Luca
>

Reply via email to