welcome, and though I've only seen it recommended once here recently, you might want to consider Tie::IxHash -- I did, where preserving order was crucial but a hash was the reasonable solution to avoid having to iterate across 2 arrays concurrently -- and it bailed me out nicely!