Probably the global %logHash is causing you grief. Try moving it inside compare.
In reply to Re: problem with while loop by GrandFather in thread problem with while loop by texuser74