Re: Strict Rakudo version of this Perl5 one-liner

2015-09-03 Thread Matija Papec
02.09.2015, 14:49, "Elizabeth Mattijsen" : >>   I think this is covered somewhere in RFC; perl6 repeatedly overwrites >> END{} block where last one references last %d definition (say %d.WHICH). >>   perl5 on the other hand stays with first END{} block (say \%d). > >  A much

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

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

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 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 >>

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

Re: Strict Rakudo version of this Perl5 one-liner

2015-09-01 Thread The Sidhekin
On Tue, Sep 1, 2015 at 5:41 PM, Matija Papec wrote: > Scoping of lexical looks interesting > > perl6 -ne 'my %d; %d{ .words[1] }++; END { %d.sort.perl.say }' > > as this could not work in perl5 > > perl -nE 'my $d =1; END { say $d//"default!" }' # gives default > It's