in reply to Re: hash with both values and keys unique to each other
in thread hash with both values and keys unique to each other

This is how I was able to do it. But it might not be a generalized solution

$seen{$chr1}++; $seen{$chr2}++; if (($seen{$chr1}>1)||($seen{$chr2}>1)){ next; } else{ $hash_chr{$chr1}=$chr2; }

Replies are listed 'Best First'.
Re^3: hash with both values and keys unique to each other
by Anonymous Monk on Jul 12, 2012 at 22:14 UTC

    Since your structure is

    loop { if (condition) { next; } # no else! other code; }

    You don't actually need the else block. Removing it will make your code look quite a bit more clean.