Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Store multiple lines

by Anonymous Monk
on Feb 09, 2018 at 13:59 UTC ( #1208830=note: print w/replies, xml ) Need Help??


in reply to Store multiple lines

Have a look at the "awk" utility. Notice how they cleanly solve such problems. Then, look at "a2p."

Replies are listed 'Best First'.
Re^2: Store multiple lines
by Anonymous Monk on Feb 09, 2018 at 19:23 UTC
    Just to clarify the change is easy. When you see a "dns" record, you capture certain things as you do now. But you don't add to "$results" until you see the subsequent type of record. (Special-case if the subsequent record does not exist ... two "dns" records back-to-back. A simple flag-variable set to True in the first case and to False in the second case can alert your first-case handler that the second-case never occurred since the first-case ran.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1208830]
help
Chatterbox?
and snow settles gently...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (8)
As of 2018-02-18 21:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    When it is dark outside I am happiest to see ...














    Results (257 votes). Check out past polls.

    Notices?