in reply to how do i find common elements of X number of arrays whose names i don't know?
You can grep the values for ref eq 'ARRAY' to get an AoA,
That uses %uniq to eliminate duplicate entries in each array. Otherwise we couldn't say from the count whether an element was in all the arrays.my @tocheck = grep { ref eq 'ARRAY' } values %{$self}; my %count; for (@tocheck) { my %uniq; @uniq{@$_} = (); for (keys %uniq) { $count{$_}++; } } my @in_all = grep { $count{$_} == @tocheck } keys %count;
After Compline,
Zaxo
|
|---|