Re: Strict Rakudo version of this Perl5 one-liner

2015-09-02 Thread yary
On Wed, Sep 2, 2015 at 12:27 PM, yary wrote: > Do perl6's Bag type and feed operators, or other features, open up a cleaner > way? scan +spam|perl6 -e ".say for lines.map({.words(2)[1]}).Bag.sort" -y

Re: Strict Rakudo version of this Perl5 one-liner

2015-09-02 Thread yary
On Tue, Sep 1, 2015 at 3:10 AM, Matija Papec wrote: > Not pretty, also you'll have to take care of -a switch, S19 calls for -a and -F, surprised Rakudo doesn't have'em! Though from later examples, the ".words" method is a fine substitute. On Tue, Sep 1, 2015 at 11:03 AM, Jonathan Scott Duff w

Re: What are Perl 6's killer advantages over Perl 5?

2015-09-02 Thread Robert Strahl via perl6-users
I don't understand why some people feel so strongly that one-liners should be strict. That would undermine what a one-liner is — a quick way to get something done. I use perl5 one-liners very frequently for text processing, especially when stringing / piping together shell code. When I need to re-u

Re: Strict Rakudo version of this Perl5 one-liner

2015-09-02 Thread Matija Papec
02.09.2015, 10:46, "The Sidhekin" : >>  So it seems that perl6 handles lexicals inside while (<>){} one-liners >> differently. > >    Ah, yes.  Interesting.  Run-time effect of C not happening repeatedly.  > How would that deparse? Good question, I wouldn't be surprised that -n switch has some

Re: Strict Rakudo version of this Perl5 one-liner

2015-09-02 Thread Elizabeth Mattijsen
> On 02 Sep 2015, at 14:02, Matija Papec wrote: > 02.09.2015, 10:46, "The Sidhekin" : >>> So it seems that perl6 handles lexicals inside while (<>){} one-liners >>> differently. >> >>Ah, yes. Interesting. Run-time effect of C not happening >> repeatedly. How would that deparse? > > >

Re: Strict Rakudo version of this Perl5 one-liner

2015-09-02 Thread The Sidhekin
On Wed, Sep 2, 2015 at 7:49 AM, Matija Papec wrote: > > I've picked a wrong example, > > seq 3 | perl -nE 'my %d; $d{$_}++; END { say keys %d }' > > vs > > seq 3 | perl6 -ne 'my %d; %d{$_}++; END { say keys %d }' > > So it seems that perl6 handles lexicals inside while (<>){} one-liners > differ