sub initHash { #init the all to all hash ##first argument is the hash of data, and the second is a reference 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; } } } }