Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: skipping lines

by davido (Cardinal)
on Dec 27, 2003 at 16:28 UTC ( [id://317195]=note: print w/replies, xml ) Need Help??


in reply to skipping lines

There's also the substr method.

while ( <FILE> ) { next if substr( $_, 0, 1 ) eq '#'; }
For simple matches anchored to a non-varying character position, substr may be a little quicker, but at the cost of being a little less Perlish. In the end, it probably doesn't matter which you use.


Dave

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (7)
As of 2024-04-23 20:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found