Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: skipping the first line of a file

by Transient (Hermit)
on Jun 12, 2009 at 13:50 UTC ( [id://770973]=note: print w/replies, xml ) Need Help??


in reply to skipping the first line of a file

my $first_line = <DATA>; while (<DATA>) { ... }
or
while (<DATA>) { next if $. == 1; }
Update: Forgot the obvious case. The first being preferred (imo) so as not to execute each iteration.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (2)
As of 2024-04-26 00:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found