Better:
my $count = () = $title =~ m{ (?:^|\s)\K \Q$kw\E (?! [^\s,;] ) }xig; [download]
In reply to Re^5: Regex help \b & \Q by ikegami in thread Regex help \b & \Q by Anonymous Monk