in reply to Re: Reading specific lines in a file
in thread Reading specific lines in a file

That's good one.
Correct me if I'm wrong. Hope this is using $_ and not $., since a while loop is roaming around the statement with perl -n .
So what would be the expanded form of this statement?

Replies are listed 'Best First'.
Re^3: Reading specific lines in a file
by Discipulus (Canon) on May 20, 2014 at 11:47 UTC
    as pointed by ambrus in the chat $. come in place because of flip flop operator
    If either operand of scalar ".." is a constant expression, that operan +d is considered true if it is equal (== ) to the current input line n +umber (the $. variable).

    HtH
    L*
    There are no rules, there are no thumbs..
    Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.
Re^3: Reading specific lines in a file
by Laurent_R (Canon) on May 20, 2014 at 15:15 UTC
    It is using implicitly both $. and $_. A possible expanded form could be:
    perl -ne 'print $_ if $. >= 60 and $. <= 70' file.txt
    or, expanding further:
    perl -e 'while (<>) {print $_ if $. >= 60 and $. <= 70;}' file.txt