http://www.perlmonks.org?node_id=1041086


in reply to Merging arrays

The mesh function from the List::MoreUtils module can be used to create a hash out of two arrays, with the n'th values from the two arrays forming the n'th key/value pair in the hash:

use List::MoreUtils qw(mesh); my @array = qw( 111 222 333 444 555 888 ); my @array2 = qw( acct1 acct2 acct3 acct4 acct5 acct8 ); my %merged = mesh @array, @array2;