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
0
ToddAndMargo
4/14/2018 5:27:13 AM
perl.perl6.users 981 articles. 0 followers. Follow

5 Replies
41 Views

Similar Articles

[PageSpeed] 44

--001a114668ac07e06a0569c92924
Content-Type: text/plain; charset="UTF-8"

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 <ToddAndMargo@zoho.com>
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
>

--001a114668ac07e06a0569c92924
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Looking at that page myself, it doesn&#39;t appear that yo=
u can specify the separator for .words.=C2=A0 So ... no.<div><br></div><div=
>Though, that would make an interesting addition IMHO</div><div><br></div><=
div>-Scott</div></div><div class=3D"gmail_extra"><br><div class=3D"gmail_qu=
ote">On Sat, Apr 14, 2018 at 12:27 AM, ToddAndMargo <span dir=3D"ltr">&lt;<=
a href=3D"mailto:ToddAndMargo@zoho.com" target=3D"_blank">ToddAndMargo@zoho=
..com</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"ma=
rgin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi All,<br>
<br>
I am over on<br>
=C2=A0 =C2=A0 <a href=3D"https://docs.perl6.org/routine/words" rel=3D"noref=
errer" target=3D"_blank">https://docs.perl6.org/routine<wbr>/words</a><br>
and I can&#39;t make heads of tails out of it.<br>
<br>
Does &quot;words&quot; have a delimiter, as does &quot;-F&quot; with awk?<b=
r>
<br>
Many thanks,<br>
-T<br>
</blockquote></div><br></div>

--001a114668ac07e06a0569c92924--
0
duff
4/14/2018 6:33:00 AM
--001a1136e58640a34d0569c93498
Content-Type: text/plain; charset="UTF-8"

"words" is just a shorthand for a common invocation of "split", really.

On Sat, Apr 14, 2018 at 1:27 AM, ToddAndMargo <ToddAndMargo@zoho.com> 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
allbery.b@gmail.com                                  ballbery@sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net

--001a1136e58640a34d0569c93498
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">&quot;words&quot; is just a shorthand for a common invocat=
ion of &quot;split&quot;, really.</div><div class=3D"gmail_extra"><br><div =
class=3D"gmail_quote">On Sat, Apr 14, 2018 at 1:27 AM, ToddAndMargo <span d=
ir=3D"ltr">&lt;<a href=3D"mailto:ToddAndMargo@zoho.com" target=3D"_blank">T=
oddAndMargo@zoho.com</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_qu=
ote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex=
">Hi All,<br>
<br>
I am over on<br>
=C2=A0 =C2=A0 <a href=3D"https://docs.perl6.org/routine/words" rel=3D"noref=
errer" target=3D"_blank">https://docs.perl6.org/routine<wbr>/words</a><br>
and I can&#39;t make heads of tails out of it.<br>
<br>
Does &quot;words&quot; have a delimiter, as does &quot;-F&quot; with awk?<b=
r>
<br>
Many thanks,<br>
-T<br>
</blockquote></div><br><br clear=3D"all"><div><br></div>-- <br><div class=
=3D"gmail_signature" data-smartmail=3D"gmail_signature"><div dir=3D"ltr"><d=
iv>brandon s allbery kf8nh =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 sine nomine associ=
ates</div><div><a href=3D"mailto:allbery.b@gmail.com" target=3D"_blank">all=
bery.b@gmail.com</a> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<a href=
=3D"mailto:ballbery@sinenomine.net" target=3D"_blank">ballbery@sinenomine.n=
et</a></div><div>unix, openafs, kerberos, infrastructure, xmonad =C2=A0 =C2=
=A0 =C2=A0 =C2=A0<a href=3D"http://sinenomine.net" target=3D"_blank">http:/=
/sinenomine.net</a></div></div></div>
</div>

--001a1136e58640a34d0569c93498--
0
allbery
4/14/2018 6:36:08 AM
--0000000000004ced250569c9dc60
Content-Type: text/plain; charset="UTF-8"

2018-04-14 7:27 GMT+02:00 ToddAndMargo <ToddAndMargo@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

--0000000000004ced250569c9dc60
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><div class=3D"gmail_extra"><br><div class=3D"gmail_quo=
te">2018-04-14 7:27 GMT+02:00 ToddAndMargo <span dir=3D"ltr">&lt;<a href=3D=
"mailto:ToddAndMargo@zoho.com" target=3D"_blank">ToddAndMargo@zoho.com</a>&=
gt;</span>:<br><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex=
;border-left:1px #ccc solid;padding-left:1ex">Hi All,<br>
<br>
I am over on<br>
=C2=A0 =C2=A0 <a href=3D"https://docs.perl6.org/routine/words" rel=3D"noref=
errer" target=3D"_blank">https://docs.perl6.org/routine<wbr>/words</a><br>
and I can&#39;t make heads of tails out of it.<br></blockquote><div><br></d=
iv><div>Can you please report that as an issue in <a href=3D"https://github=
..com/perl6/doc/issues">https://github.com/perl6/doc/issues</a>?<br></div></=
div><br></div><div class=3D"gmail_extra">Cheers<br><br></div><div class=3D"=
gmail_extra">JJ<br></div></div>

--0000000000004ced250569c9dc60--
0
jjmerelo
4/14/2018 7:23:08 AM
--089e082da348e2a6860569cd7dcc
Content-Type: text/plain; charset="UTF-8"

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 <jjmerelo@gmail.com> wrote:

>
>
> 2018-04-14 7:27 GMT+02:00 ToddAndMargo <ToddAndMargo@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
>

--089e082da348e2a6860569cd7dcc
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>What&#39;s an elegant way of asking for the last two =
words? I have this:<br><br>&#39;foo bar bat&#39;.words[*-2..*]; =C2=A0=C2=
=A0 # (bar bat)<br><br></div>I bet it could be better...<br></div><div clas=
s=3D"gmail_extra"><br clear=3D"all"><div><div class=3D"gmail_signature" dat=
a-smartmail=3D"gmail_signature">-y<br></div></div>
<br><div class=3D"gmail_quote">On Sat, Apr 14, 2018 at 3:23 AM, JJ Merelo <=
span dir=3D"ltr">&lt;<a href=3D"mailto:jjmerelo@gmail.com" target=3D"_blank=
">jjmerelo@gmail.com</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_qu=
ote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex=
"><div dir=3D"ltr"><br><div class=3D"gmail_extra"><br><div class=3D"gmail_q=
uote"><span class=3D"">2018-04-14 7:27 GMT+02:00 ToddAndMargo <span dir=3D"=
ltr">&lt;<a href=3D"mailto:ToddAndMargo@zoho.com" target=3D"_blank">ToddAnd=
Margo@zoho.com</a>&gt;</span>:<br><blockquote class=3D"gmail_quote" style=
=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi All,<=
br>
<br>
I am over on<br>
=C2=A0 =C2=A0 <a href=3D"https://docs.perl6.org/routine/words" rel=3D"noref=
errer" target=3D"_blank">https://docs.perl6.org/routine<wbr>/words</a><br>
and I can&#39;t make heads of tails out of it.<br></blockquote><div><br></d=
iv></span><div>Can you please report that as an issue in <a href=3D"https:/=
/github.com/perl6/doc/issues" target=3D"_blank">https://github.com/perl6/do=
c/<wbr>issues</a>?<br></div></div><br></div><div class=3D"gmail_extra">Chee=
rs<span class=3D"HOEnZb"><font color=3D"#888888"><br><br></font></span></di=
v><span class=3D"HOEnZb"><font color=3D"#888888"><div class=3D"gmail_extra"=
>JJ<br></div></font></span></div>
</blockquote></div><br></div>

--089e082da348e2a6860569cd7dcc--
0
not
4/14/2018 11:42:44 AM
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 <jjmerelo@gmail.com> wrote:
> 
> >
> >
> > 2018-04-14 7:27 GMT+02:00 ToddAndMargo <ToddAndMargo@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
> >
0
bduggan2
4/14/2018 11:53:33 AM
Reply: