use strict; use warnings; use Data::Dumper; my $hash_ref; my @array1 = qw( some_unique_key1 some_unique_key2 some_unique_key3 ); my @array2 = qw( meta_data_1 metadata_2 metadat_3 ); my @array3 = qw( submitted_date1 submitted_date2 submitted_date3 ); @{$hash_ref->{'Metadata'}}{ @array1 } = @array2; @{$hash_ref->{'Submitted date'}}{ @array1 } = @array3; print Dumper $hash_ref;