in reply to Retrieve unique values from Hash of Hashes

To add to ikegami's solution, this is how you would print the unique names:
print "$HoH{$_}{user}\n" for (@unique_users);

updated....


Excellence is an Endeavor of Persistence. Chance Favors a Prepared Mind.

Replies are listed 'Best First'.
Re^2: Retrieve unique values from Hash of Hashes
by ikegami (Patriarch) on Nov 10, 2009 at 04:49 UTC

    There's a bug in my code. You seem to imply the bug is simply my choice of array name. I disagree. If that's the bug, we have redundant code ($HoH{$_}{user}). And simply put, it makes no sense to end up with a bunch of IP addresses when looking for unique users.

    My code should have been

    my %seen; my @unique_users = grep !$seen{$_}++, map $HoH{$_}{user}, keys(%HOH);