my %hTemp; my @aTemp = map{@{$_}} ([1,2], [1,3], [2,3], [2,4], [3,4]); @hTemp{@aTemp} = (); print join ",",(sort keys %hTemp);