key1 -> 1 2 3 4 5 6 7 8 key2-> 4 6 7 8 3 2 9 7 key3-> 2 3 5 8 9 1 1 2 #### for my $hash_count ( sort {$a<=>$b} keys %hash){ print "($hash_count)-> @{$hash{$hash_count}}\n"; } #### for $hash_count ( sort {$a<=>$b} keys %hash){ push @spread_array,"$hash{$hash_count}"; } $worksheet->write_col(1,1,\@spread_array);