You can use tail:

$ perl6 -e 'say <foo bar bat>.words.tail(2)'
(bar bat)

On Saturday, April 14, yary wrote: 
> What's an elegant way of asking for the last two words? I have this:
> 
> 'foo bar bat'.words[*-2..*];    # (bar bat)
> 
> I bet it could be better...
> 
> -y
> 
> On Sat, Apr 14, 2018 at 3:23 AM, JJ Merelo <jjmer...@gmail.com> wrote:
> 
> >
> >
> > 2018-04-14 7:27 GMT+02:00 ToddAndMargo <toddandma...@zoho.com>:
> >
> >> Hi All,
> >>
> >> I am over on
> >>     https://docs.perl6.org/routine/words
> >> and I can't make heads of tails out of it.
> >>
> >
> > Can you please report that as an issue in https://github.com/perl6/doc/
> > issues?
> >
> > Cheers
> >
> > JJ
> >

Reply via email to