How would P5 handle line numbers > 10 ? Not getting back line #11 with
the P5 examples below:

$ raku -ne '.say if ++$ == 3|2|5|11' test_lines.txt
Line 2
Line 3
Line 5
Line 11

~$ perl -ne 'print if $. =~ /\b[3 2 5 11]\b/' test_lines.txt
Line 1
Line 2
Line 3
Line 5

~$ perl -ne 'print if $. =~ /\b[3,2, 5, 11]\b/' test_lines.txt
Line 1
Line 2
Line 3
Line 5

On Mon, Aug 31, 2020 at 8:17 AM Brian Duggan <bdug...@matatu.org> wrote:
>
> On Monday, August 31, Andy Bach wrote:
> > >  raku -ne '.say if $++ == 3|2|5' Lines.txt
> >
> > OT, maybe, but is
> > perl -ne 'print if $. =~ /\b[325]\b/' Lines.txt
> >
> > or
> > perl -ne 'print if $c++ =~ /\b[436]\b/' Lines.txt
> >
> > the best you can do in P5?
>
> I can't think of anything better :-)
>
> Brian

Reply via email to