in reply to Counting instances in a hash from an array
Nearly there, as far as I can see
foreach my $keyLOOK(keys %UnNum){ foreach my $word(@midWords){ if $word == $keyLOOK { $UnNum{$keyLOOK}++; } } }
Or, alternatively..
foreach(keys %UnNum){ foreach my $word(@midWords){ if $word eq $_ { $UnNum{$_}++; } } }
|
|---|