in reply to Faster Common Hash key hunt
Update: ++jlf for sharp eyes and kind acts. Typo repaired.
Update2: ++maverick for the heads-up and the good solution. Here is another way to do it as a function with a list of hashrefs:
This doesn't do much copying. Returns an array ref to keys common to all.sub commonkeys { my %common = %{-shift}; for my $hr (@_) { delete @common{ grep { !exists $hr->{$_} } keys %common }; } [keys %common] }
After Compline,
Zaxo
|
|---|