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

Reply via email to