Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: seek and process from there on

by zakame (Pilgrim)
on May 30, 2006 at 15:56 UTC ( #552532=note: print w/replies, xml ) Need Help??


in reply to seek and process from there on

Perhaps you wanted something like this:
open STUFF, "<", $file or die "Can't open $file: $!"; while (<STUFF>) { chomp; $seen{internal_name}++, next if /^internal name/; if ($seen{internal_name}) { if (/^need this/) { # do your stuff here } } }
At the start, nothing is done until /^internal name/ is seen. If we see one, we just take note of that in a hash key, which we test later on when we get to do the real work. Update: I suddenly remembered there was a predefined DATA filehandle...

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (6)
As of 2019-05-25 22:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you enjoy 3D movies?



    Results (152 votes). Check out past polls.

    Notices?
    • (Sep 10, 2018 at 22:53 UTC) Welcome new users!