in reply to @array1 vs @array2

While this is doable I would suggest playing around with DBI and DBD::RAM or else learning references and using arrays of hashes.