Re: Does words have a delimiter?
You can use tail: $ perl6 -e 'say .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 wrote: > > > > > > > 2018-04-14 7:27 GMT+02:00 ToddAndMargo : > > > >> 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 > >
Re: Does words have a delimiter?
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 wrote: > > > 2018-04-14 7:27 GMT+02:00 ToddAndMargo : > >> 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 >
Re: Does words have a delimiter?
2018-04-14 7:27 GMT+02:00 ToddAndMargo : > 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
Re: Does words have a delimiter?
"words" is just a shorthand for a common invocation of "split", really. On Sat, Apr 14, 2018 at 1:27 AM, ToddAndMargo wrote: > Hi All, > > I am over on > https://docs.perl6.org/routine/words > and I can't make heads of tails out of it. > > Does "words" have a delimiter, as does "-F" with awk? > > Many thanks, > -T > -- brandon s allbery kf8nh sine nomine associates allber...@gmail.com ballb...@sinenomine.net unix, openafs, kerberos, infrastructure, xmonadhttp://sinenomine.net
Re: Does words have a delimiter?
Looking at that page myself, it doesn't appear that you can specify the separator for .words. So ... no. Though, that would make an interesting addition IMHO -Scott On Sat, Apr 14, 2018 at 12:27 AM, ToddAndMargo wrote: > Hi All, > > I am over on > https://docs.perl6.org/routine/words > and I can't make heads of tails out of it. > > Does "words" have a delimiter, as does "-F" with awk? > > Many thanks, > -T >
Does words have a delimiter?
Hi All, I am over on https://docs.perl6.org/routine/words and I can't make heads of tails out of it. Does "words" have a delimiter, as does "-F" with awk? Many thanks, -T