I think you're going to have to post some code, as there aren't many clues here. Possibly it's something to do with passing your $q back and forth to a subroutine - are you sure you're maipulating the same object? Impossible to tell though without seeing.