use strict; use warnings; # use Data::Dumper; my %hash = (); my @array1 = qw(a b c d e); my @array2 = qw(1 2 3 4 5); push @{$hash{col1}}, @array1; push @{$hash{col2}}, @array2; # print Dumper(%hash); # Result should look like this: # col1,col2, # a,1 # b,2 # c,3 # d,4 # e,5