in reply to Re: Retrieve unique values from Hash of Hashes
in thread Retrieve unique values from Hash of Hashes
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);
|
|---|