in reply to Explanation of an one-liner

If the POD explanation isn't enough, it wasn't for me having never used sed or awk to any great extent, then this might clarify things.

perl -e"open ARGV,'<',$ARGV[0]or die $!; while(<ARGV>){ print if $. >= +15 and $. <=17 }" file

This is (roughly) analogous to the one-liner you showed except it will only handle a single input file. The open and while parts are performed for you by the -n command line switch. See perlrun for details.

The 15 .. 17 is (roughly) equivalent to the if condition above.


Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"Think for yourself!" - Abigail
Hooray!