Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: next line

by mrbbking (Hermit)
on May 16, 2002 at 16:28 UTC ( #167042=note: print w/ replies, xml ) Need Help??


in reply to how do I get perl to skip lines reading a text file?

To skip to the next line, after having found what you're looking for...

open( FH, $yourfile ) or die "Can't open $yourfile: $!\n"; while( <FH> ){ next if /pattern_indicating_line_to_skip/; # otherwise, do stuff... }


Comment on Re: next line
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (7)
As of 2015-07-05 23:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (68 votes), past polls