in reply to Simple log parser I hope!
The get_record function should read one block (up to the equals signs) and return a list of key/value pairs. The output_record function should pass along your Px, Py pair. I'll leave those to you to code.my %needed_transaction; while (my %record = get_record()) { if ($record{CALL_INIT} and $record{CHAN_TYPE} =~ /TCH/ ) { $needed_transaction{ $record{TRAN_ID} } = 1; } elsif ($record{CALL_RESPONSE} and $needed_transaction{ $record{TRAN_ID} } ) { output_record(%record); delete $needed_transaction{ $record{TRAN_ID} }; } }
Personally I would pass around anonymous hash references rather than hashes, but I don't know if you know about references. If you want to try that, a good starting point is references quick reference. But as I say, you don't need to go that route to get a working solution.
|
|---|