Re: ctxlexpad needs an MVMContect

2017-08-04 Thread WFB
Well spotted. I totally muss that. However, that was not the only mistakes I did. Another problem is to use # commentaries in grammars. Which causes also the exception. Thanks for the help! On 4 August 2017 at 08:22, yary wrote: > Is this line intentional? > > token

how do you pipe to perl6?

2017-08-04 Thread Todd Chester
Hi All, In Linux, how do I things to a perl6 one liner? I want to send ip -o -f inet addr show | perl6 ***dig out the netmask on eno1*** I know how to dig out the net mask, I just don't how to pipe to the command. Many thanks, -T

Re: how do you pipe to perl6?

2017-08-04 Thread Simon Proctor
>From the perl6 -h response you have the standard Perl command line switches -e program one line of program, strict is enabled by default With this case $*IN has the content from the pipe going into it. Personally I combine -e with one of the next two -n run

Re: how do you pipe to perl6?

2017-08-04 Thread ToddAndMargo
On 08/04/2017 01:07 AM, Elizabeth Mattijsen wrote: On 4 Aug 2017, at 09:47, Todd Chester wrote: In Linux, how do I things to a perl6 one liner? I want to send ip -o -f inet addr show | perl6 ***dig out the netmask on eno1*** I know how to dig out the net mask, I just

Re: split and one liner problem

2017-08-04 Thread ToddAndMargo
> On Friday, August 4, 2017, ToddAndMargo > wrote: > > Hi All, > > > What am I doing wrong here? > > $ echo -e "abc\ndef\nghi" | perl6 -e 'for ( split "\n", lines ) { > say "<$_>"; }' > > > > > I am trying to get >

Help me be greedy!

2017-08-04 Thread ToddAndMargo
Hi All, I NEED TO BE GREEDY! HAHA HAHA . Okay, I am back in control of myself (for the moment). What am I doing wrong here? perl6 -e 'my $x="a b c d e f"; $x ~~ m/.*?(c.*?).*f/; say "<$0>";' I am after I want the space at the end too

Re: Help me be greedy!

2017-08-04 Thread Brandon Allbery
Like I said, greedy is the default, *.? says *don't* be greedy. You wanted .* for greedy match. But even with that, the extra .* before the f was telling it to eat stuff (greedily, since no ?, so it out-greed-ed the captured non-greedy .*?). On Friday, August 4, 2017, ToddAndMargo

Re: Need awk print sub

2017-08-04 Thread Elizabeth Mattijsen
> On 4 Aug 2017, at 22:00, ToddAndMargo wrote: > > Hi All, > > How do I do this with a perl one liner? > > $ echo "a b c d" | awk '{print $2}' > b echo "a b c d" | perl6 -e 'say words[1]’ Note array indices in Perl 6 are 0 based.

Re: Need awk print sub

2017-08-04 Thread ToddAndMargo
On 08/04/2017 01:00 PM, ToddAndMargo wrote: Hi All, How do I do this with a perl one liner? $ echo "a b c d" | awk '{print $2}' b Many thanks, -T And it is getting weirder: $ echo "a b c d" | perl6 -n -e 'say lines ~ "\n" ~ .words[2];' ( c) without "-n" ".words" doesn't work. With "-n"

Re: Need awk print sub

2017-08-04 Thread ToddAndMargo
>> Hi All, >> >> How do I do this with a perl one liner? >> >> $ echo "a b c d" | awk '{print $2}' >> b >> >> Many thanks, >> -T On 08/04/2017 01:31 PM, Patrick R. Michaud wrote: How about... $ echo "a b c d" | ./perl6 -n -e '.words[1].say' b Pm On Fri, Aug 04, 2017 at 01:00:52PM -0700,

split and one liner problem

2017-08-04 Thread ToddAndMargo
Hi All, What am I doing wrong here? $ echo -e "abc\ndef\nghi" | perl6 -e 'for ( split "\n", lines ) { say "<$_>"; }' I am trying to get

Re: split and one liner problem

2017-08-04 Thread Brandon Allbery
That's a weird thing to do. You call a function that returns the lines of input as a list, in a context that joins them back together as words, and then try to split the result on lines again. lines already gives you what you want. Don't split. perl6 -e 'for lines { say "<$_>"; }' On Friday,

Re: split and one liner problem

2017-08-04 Thread ToddAndMargo
On 08/04/2017 12:07 PM, Brandon Allbery wrote: Sorry, I forgot the block thing (it reads the following block as a parameter). ``` lines() ``` would also have worked. I really appreciate the help. And it was a good exercise in troubleshooting!

Re: how do you pipe to perl6?

2017-08-04 Thread ToddAndMargo
On Fri, 4 Aug 2017 at 08:47 Todd Chester > wrote: Hi All, In Linux, how do I things to a perl6 one liner? I want to send ip -o -f inet addr show | perl6 ***dig out the netmask on eno1*** I know how to dig out the

Re: Help me be greedy!

2017-08-04 Thread Brandon Allbery
The ? is the opposite of greedy, just as in pcre/perl 5. Greedy is the default. I also don't see why you have a .* before f if you want to capture everything before the f. On Friday, August 4, 2017, ToddAndMargo wrote: > Hi All, > > I NEED TO BE GREEDY! HAHA HAHA . > >

Re: split and one liner problem

2017-08-04 Thread Brandon Allbery
Sorry, I forgot the block thing (it reads the following block as a parameter). ``` lines() ``` would also have worked. On Friday, August 4, 2017, ToddAndMargo wrote: > > > On Friday, August 4, 2017, ToddAndMargo > >

Need awk print sub

2017-08-04 Thread ToddAndMargo
Hi All, How do I do this with a perl one liner? $ echo "a b c d" | awk '{print $2}' b Many thanks, -T

Re: Help me be greedy!

2017-08-04 Thread ToddAndMargo
On Friday, August 4, 2017, ToddAndMargo > wrote: Hi All, I NEED TO BE GREEDY! HAHA HAHA . Okay, I am back in control of myself (for the moment). What am I doing wrong here? perl6 -e 'my $x="a b c d e f"; $x ~~

Re: Need awk print sub

2017-08-04 Thread Patrick R. Michaud
How about... $ echo "a b c d" | ./perl6 -n -e '.words[1].say' b Pm On Fri, Aug 04, 2017 at 01:00:52PM -0700, ToddAndMargo wrote: > Hi All, > > How do I do this with a perl one liner? > > $ echo "a b c d" | awk '{print $2}' > b > > Many thanks, > -T

Re: Need awk print sub

2017-08-04 Thread ToddAndMargo
On 08/04/2017 01:26 PM, Elizabeth Mattijsen wrote: echo "a b c d" | perl6 -e 'say words[1]’ Tears. :'( $ echo "a b c d" | perl6 -e 'say words[1]' ===SORRY!=== Error while compiling -e Calling words() will never work with any of these multi signatures: ($what, $limit = Inf, *%named) at

Re: Need awk print sub

2017-08-04 Thread ToddAndMargo
On 08/04/2017 01:53 PM, ToddAndMargo wrote: $ echo "a b c d" | perl6 -e 'say words[1]' And with the . before words $ echo "a b c d" | perl6 -e 'say .words[1]' No such method 'words' for invocant of type 'Any' in block at -e line 1

Re: Need awk print sub

2017-08-04 Thread ToddAndMargo
On 08/04/2017 03:42 PM, Brandon Allbery wrote: On Fri, Aug 4, 2017 at 6:28 PM, ToddAndMargo > wrote: Here is my last attempt: ip -o -f inet addr show | perl6 -e 'for ( lines ) -> $I { if ( $I ~~ /enp/ ) { say "Interface <" ~

Thank you guys!

2017-08-04 Thread ToddAndMargo
Today you guys taught me how to 1) pipe to a one liner 2) use split in P6 (a little different than p5) 3) lines 4) words Thank you!

another one liner

2017-08-04 Thread ToddAndMargo
Hi All, How would you convert this one liner over to a Perl 6 one liner with a pipe? ifconfig | grep flags | awk '{print $1}' | sort | sed -n 2,2p | sed -e 's/://' enp6s0 Many thanks, -T # ifconfig br0: flags=4099 mtu 1500 inet 192.168.255.10 netmask

Got me one too many p6's

2017-08-04 Thread ToddAndMargo
Hi All, Believe it or not EPEL beat Fedora to Rakudo 2017.07. Now I got me two perl 6's $ /opt/rakudo/bin/perl6 -v This is Rakudo version 2017.03 built on MoarVM version 2017.03 implementing Perl 6.c. $ /usr/bin/perl6 -v This is Rakudo version 2017.07 built on MoarVM version 2017.07

Re: another one liner

2017-08-04 Thread ToddAndMargo
On 08/04/2017 08:14 PM, Timo Paulssen wrote: ifconfig | perl6 -e 'lines.grep("flags").map(*.words[0]).sort[1].chop' this should do the trick. i'm not sure if 2,2p is meant to "output just the second result" and if it's okay to just unconditionally remove the last character. hth - Timo

Re: Need awk print sub

2017-08-04 Thread ToddAndMargo
On 08/04/2017 02:13 PM, Brandon Allbery wrote: (back on the desktop for the moment...) On Fri, Aug 4, 2017 at 5:04 PM, ToddAndMargo > wrote: On 08/04/2017 01:00 PM, ToddAndMargo wrote: How do I do this with a perl one liner?

Re: Help me be greedy!

2017-08-04 Thread ToddAndMargo
On 08/04/2017 03:24 PM, Brent Laabs wrote: PCRE has the /U flag that reverses the behavior of .* and .*? (/PCRE_UNGREEDY)/ Greed ultimately wasn't the issue. I screwed up a bunch of other things.

Re: Need awk print sub

2017-08-04 Thread ToddAndMargo
On 08/04/2017 02:31 PM, Elizabeth Mattijsen wrote: On 4 Aug 2017, at 22:53, ToddAndMargo wrote: On 08/04/2017 01:26 PM, Elizabeth Mattijsen wrote: echo "a b c d" | perl6 -e 'say words[1]’ Tears. :'( $ echo "a b c d" | perl6 -e 'say words[1]' ===SORRY!=== Error

Re: another one liner

2017-08-04 Thread ToddAndMargo
On 08/04/2017 08:43 PM, Bruce Gray wrote: On Aug 4, 2017, at 9:12 PM, ToddAndMargo wrote: Hi All, How would you convert this one liner over to a Perl 6 one liner with a pipe? ifconfig | grep flags | awk '{print $1}' | sort | sed -n 2,2p | sed -e 's/://‘ —snip—