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

Re: Parsing Logs

by moritz (Cardinal)
on Oct 05, 2012 at 16:59 UTC ( #997516=note: print w/replies, xml ) Need Help??

in reply to Parsing Logs

I'm having trouble with the foreach within a foreach loop. I can't figure out how to do this effectively.

The trick is not to use two nested loops. Instead use the session ID as a key in a hash, and then when interating through @array, extract the session ID from each line, and check if the session ID exists in a hash. That should reduce the runtime from O(@array * @sessionID) to something more along the lines of O(@array + @sessionID).

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://997516]
holli just found out one of his friends is a flat-earther

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (8)
As of 2017-10-24 12:24 GMT
Find Nodes?
    Voting Booth?
    My fridge is mostly full of:

    Results (289 votes). Check out past polls.