in reply to Counting instances in a hash from an array

hope this helps:
use strict; use warnings; my @array = qw(bodi forc twice mass acceler law); my %UnNum = ( 'forc two bodi twice strong on bodi sai bodi mass' => 35, 'you expect on think new bodi made two bodi origin' => 39, 'attract bodi b origin force' => 60, 'total forc b twice origin force' => 46, 'sai on bodi twice mass three time mass forc six' => 34, 'on now see why bodi fall same rate bodi twice' => 17, ); foreach my $text (keys %UnNum) { map { $UnNum{$text}++ while $text =~ /\b$_\b/g; } @array; }