> 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? a Andy Bach, BS, MSCMECFA Systems Mangler Internet: andy_b...@wiwb.uscourts.gov<mailto:andy_b...@wiwb.uscourts.gov> Voice: (608) 261-5738, Cell: (608) 658-1890 "The three great problems of computer science: compiler complexity and 'off-by-one' errors". https://martinfowler.com/bliki/TwoHardThings.html ________________________________ From: Brian Duggan <bdug...@matatu.org> Sent: Monday, August 31, 2020 7:53 AM To: Curt Tilmes <c...@tilmes.org> Cc: perl6-users <perl6-us...@perl.org> Subject: Re: print particular lines question 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