Basically : $ raku -e 'my $a = 1; say ++$a; say $a' 2 2 $ raku -e 'my $a = 1; say $a++; say $a' 1 2
On Mon, Aug 31, 2020 at 8:36 PM yary <not....@gmail.com> wrote: > $ by itself is an anonymous variable, putting ++ after starts it at 0 (hmm > or nil?) and increments up. > > By putting the plus plus first, ++$, it will start at 1, thanks to > pre-increment versus post increment > > On Mon, Aug 31, 2020, 4:20 PM ToddAndMargo via perl6-users < > perl6-us...@perl.org> wrote: > >> On 2020-08-31 05:53, Brian Duggan wrote: >> > On Monday, August 24, Curt Tilmes wrote: >> >> $ cat Lines.txt | raku -e '.say for lines()[3,2,5]' >> > >> > The -n flag is an option here too: >> > >> > raku -ne '.say if $++ == 3|2|5' Lines.txt >> > >> > Brian >> > >> >> Hi Bill, >> >> Works beatifically! And no bash pipe! >> >> $ raku -ne '.say if $++ == 3|2|5' Lines.txt >> Line 2 >> Line 3 >> Line 5 >> >> What is `$++`? >> >> -T >> > -- Aureliano Guedes skype: aureliano.guedes contato: (11) 94292-6110 whatsapp +5511942926110