Hi All,

https://docs.perl6.org/routine/words
is no help

Not to ask too obvious a question, but why does words use a []
instead of a () ?


$ ls -al Win10_1803_English_x64.dd
-rwxrwxrwx. 1 todd root 7927234560 May  9 21:14 Win10_1803_English_x64.dd


$ ls -al Win10_1803_English_x64.dd | p6 'my $x = slurp(); say $x.words[4]'
7927234560


This is not the forth word:

$ ls -al Win10_1803_English_x64.dd | p6 'my $x = slurp(); say $x.words(4)'
(-rwxrwxrwx. 1 todd root)


Many thanks,
-T


Another way to read a pipe.  The "n" must come before the "e"

$ ls -al Win10_1803_English_x64.dd | perl6 -ne 'say $_.words[4]'
2730070016

Reply via email to