in reply to headache with arrays.

You have more headaches than you think or are (probably) capable of dealing with, given my assumption of your relatively-new Perl skills. You're entering problems with symbolic references, variable naming, and a host of other issues.

I would strongly suggest you go into a little more detail about what you're trying to do and let us help you with how you might want to do it. Your requirements are a little vague.

------
We are the carpenters and bricklayers of the Information Age.

Then there are Damian modules.... *sigh* ... that's not about being less-lazy -- that's about being on some really good drugs -- you know, there is no spoon. - flyingmoose

I shouldn't have to say this, but any code, unless otherwise stated, is untested