Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Skip 21 Lines

by Beatnik (Parson)
on Apr 24, 2001 at 19:16 UTC ( [id://75088]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://75088]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (2)
As of 2024-04-25 22:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found