in reply to Re: picking x numbers of lines from a file
in thread picking x numbers of lines from a file

Actually, the scalar range operator defaults to testing against equality with C<$.> So, more simply, the above code becomes:  ($from .. $to) && print while <DATA>

Replies are listed 'Best First'.
RE: RE: Re: picking x numbers of lines from a file
by larsen (Parson) on Sep 19, 2000 at 17:12 UTC
    From Perl 5.004 docs:
    If either operand of scalar ".." is a numeric literal, that operand is implicitly compared to the $. variable, the current line number.
    This is an excerpt from MacPerl documentation (I'm used to program on Macintosh). On my Linux box (with Perl 5.004 installed) the phrase is (I think):
    If eitrher operand ... is a constant
    Am I missing something?
    -- "Fatti non foste a viver come bruti"