in reply to Processing a dynamic array

I did something very similar to what you want to achieve here. I check the hash %seen (equivalent of your %z) on the way in, which means that duplicates never get into the array in the first place.

--

Oh Lord, won’t you burn me a Knoppix CD ?
My friends all rate Windows, I must disagree.
Your powers of persuasion will set them all free,
So oh Lord, won’t you burn me a Knoppix CD ?
(Missquoting Janis Joplin)