Drop the extra arrays you're currently using to preserve order, and then use Tie::IxHash.
In reply to Re: AoHoAoH... am I delusional? by tobyink in thread AoHoAoH... am I delusional? by jaydstein