in reply to Simple log parser

Shouldn't your string compares (i.e. ($tt == 'pm')) use the eq operator ($tt eq 'pm')? Try it with that change.
Cheers;