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).
In reply to Re: Parsing Logs
by moritz
in thread Parsing Logs
by mdotpl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |