Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: discard lines after match

by boftx (Deacon)
on Nov 10, 2014 at 20:22 UTC ( [id://1106742]=note: print w/replies, xml ) Need Help??


in reply to discard lines after match

Not knowing the full size of the data set this might be overkill, but...

It looks like you can start a hash for each vhost you see, and stick the name of it in $vh or whatever. Then if you see "NO VIRTUAL" simply delete the hash and go on to the next line. In the hash itself you would collect the data elements for each VTD in its own hash. When you see the next vhost tag push the hash you just build onto an array of hashref. Once you see the end of the data ("__DISCARD__") break out of the loop and loop through the array, formating and printing or processing as desired.

You must always remember that the primary goal is to drain the swamp even when you are hip-deep in alligators.

Log In?
Username:
Password:

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

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

    No recent polls found