in reply to Skip 21 Lines

Something I always use for the xth line of a file....
(undef,undef,undef,undef,$line) = <FILE>;
Greetz
Beatnik
... Quidquid perl dictum sit, altum viditur.

Replies are listed 'Best First'.
Re: Re: Skip 21 Lines
by merlyn (Sage) on Apr 24, 2001 at 19:38 UTC
    Something I always use for the xth line of a file....
    (undef,undef,undef,undef,$line) = <FILE>;
    At the expense of reading the entire file and tossing all but one of the lines. Ouch!

    -- Randal L. Schwartz, Perl hacker

      Isn't it more maintainable to write that as:
      $line = (<FILE>)[4];
      ?
    A reply falls below the community's threshold of quality. You may see it by logging in.