in reply to Re: How to divide the value of a hash key by the value of another hash key (when the keys are equivalent)?
in thread How to divide the value of a hash key by the value of another hash key (when the keys are equivalent)?
sub initHash { #init the all to all hash ##first argument is the hash of data, and the second is a referenc +e to all the columns my ($refHash, $refArr) = @_; foreach my $ele1(@$refArr){ foreach my $ele2(@$refArr){ my $key = $ele1 . "." . $ele2; if (exists $$refHash{$key}){ print STDERR "This key existed in your array of names, + skipping\n"; next; } else{ $$refHash{$key} = 0; } } } }
|
|---|