# perl -le'$cnt+=@{[m/\bhello\b/g]}for"aahello hello hello","bb heelo hello phello";print$cnt' 3