Thanks again this seems to have worked.
I was thinking about this a bit more and recall at one point in writing PERL modules for my own sort of cgi based quizzes I needed to use Tie::IxHash to preserve ordering. I had that on my old server and not the newest one. I'm going to try adding Tie::IxHash in the near future and see if that makes any difference.
In the meantime your fix works. I'll change the problems. Thanks again.