>>607
始めそう思ったが駄目なはず。
@a = ($str =~ /\b$KEY\b/og); $count = scalar(@a);
破壊してよいなら、リファレンスマニュアル的に
$count = ($str =~ s/\b$KEY\b//og);