in reply to flip-flop interpolation
$i = 2; $j = 4; print "$_\n" for ($i..$j);
Output:
2 3 4
Update: I missed what was obvious to choroba. Not so much a flip-flop as a filter:
# show lines 2 thru 4 while (<>) { print if 2..4 } # this will print every line $i = 2; $j = 4; while (<>) { print if $i..$j }
|
---|