in reply to Odd number of elements error

I assume you're getting the error when you initialize $data. This has happened to me. Add one more definition with a key-value you'll never use (e.g. "____") and a value of undef.

This doesn't explain the cause of the problem, and I regret not being able to help you there. But the work-around prevents the error.

(I ++ you for asking the question, and look forward to wiser Monks than I answering it...)