Confusing Perl code
- by titaniumdecoy
I don't understand the last line of this function from Programming Perl 3e.
Here's how you might write a function that does a kind of set intersection by returning a list of keys occurring in all the hashes passed to it:
@common = inter( \%foo, \%bar, \%joe );
sub inter {
my %seen;
for my $href (@_) {
while (my $k = each %$href) {
…