Well, you still don't say what sort of logs these are so I can't say if there is an in-use issue. I did notice though that you are trying to compare a string with a value.

If ($result1 < $sub1)
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.