Created
August 22, 2012 15:56
-
-
Save Osse/3426980 to your computer and use it in GitHub Desktop.
Find duplicates
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sub findDuplicates { | |
# @info is an array of hashrefs | |
my @keys = keys $info[0]; | |
grep { | |
for (my $i = 0; $i < scalar(@info) - 1; $i++) { | |
# I want to remove any keys from @keys if two adjacent | |
# values in $info are unequal for the same key | |
$info[$i]{$_} eq $info[$i]{$_} | |
} | |
} @keys; | |
return @keys; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment