in reply to manipulating a hash of arrays

You're none too clear about what you're trying to accomplish. The keys of a hash are all unique. You can check existence of keys from an array with grep over a slice,

my %found_keys; for my $key (keys %hoa) { $found_keys{$key} = [grep { exists $hoa{$_} and $_ ne $key } @{$hoa{$key}}]; }
That gives you another HoA containing only the elements of the original which match other internal keys than their own.

I'm not positive that's what you want, but I hope it helps.

After Compline,
Zaxo