# 1) store it in a reference: my $hashref = correlation(\@primarys_array, @secondarys_array); # 2) deference it and store it in a hash: my %hash = %{ correlation(\@primarys_array, @secondarys_array) };