skip to main | skip to sidebar

Perl note

Friday, January 4, 2008

delete duplicate hash value's

my %seen;
for my $key (keys %students) {
my $value_key = "@{[values %{$students{$key}}]}";
if (exists $seen{$value_key}) {
delete $students{$key};
}
else {
$seen{$value_key}++;
}
}
undef %seen;
Posted by raj at 3:12 AM
Labels: delete duplicate hash value's

No comments:

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments (Atom)

Blog Archive

  • ▼  2008 (12)
    • ▼  January (12)
      • The Subroutine Stack
      • How to Use the Windiff.exe Utility
      • Row and Array Comparisons in postgresql
      • Array Functions
      • Printing an Associative Array
      • Checking the Existence of an Element
      • How to Create a Bullet List in Microsoft Excel
      • installing module
      • isArray() in Perl
      • ordering hash
      • delete duplicate hash value's
      • Finding oldest file in directory
  • ►  2007 (84)
    • ►  December (22)
    • ►  November (6)
    • ►  October (9)
    • ►  September (1)
    • ►  August (41)
    • ►  July (5)

About Me

raj
View my complete profile