Dear Monks,
can you please guide me on how to find the number of unique elements in a hash of arrays?
I know that, if you have a normal array, you can just do:
$unique_ids = scalar(grep {defined $_} @normal_array);
but how can I do the same thing if there is a has of arrays involved? For example, how do you find the number of unique elements in the array for each of the keys in this example
%HoA = (
flintstones => [ "fred", "barney","barney", "nick", "john", "barne
+y" ],
jetsons => [ "george", "jane", "elroy", "mike", "elias" ],
simpsons => [ "homer", "marge", "bart", "jack", "homer" ],
);