Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^5: Extract lines between two patterns

by philipbailey (Chaplain)
on Jan 22, 2012 at 09:38 UTC ( #949237=note: print w/ replies, xml ) Need Help??


in reply to Re^4: Extract lines between two patterns
in thread Extract lines between two patterns

Please don't ignore requests to use <code> tags. You can edit your posts and add them. Having posted runnable code, the issues become more obvious: you open file "block.power" for writing, not reading--so use "<", not ">" (and you don't test whether the open succeeds). Your while loop loops infinitely over "$fh", which is always true; you should say while (<$fh>) {, which actually reads from the filehandle. The undefined variable in the pattern match is in fact $_.


Comment on Re^5: Extract lines between two patterns
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (12)
As of 2015-07-31 07:55 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 (275 votes), past polls