# show lines 2 thru 4 while (<>) { print if 2..4 } # this will print every line $i = 2; $j = 4; while (<>) { print if $i..$j }