Have you checked that $partnum contains what you expect it to?
In reply to Re: Odd Hash behavior by tedrek in thread Odd Hash behavior by SpritusMaximus