hello pleas give me perl script for finding given sting in other string & also it can found how many it is repeated i tried out but it is not able to give me hw many time it is repeated.
Update:
$cnt =0;
$str =" hi hi how hi i am here ";
if ( $str=~/([hi])/g)
{
$cnt++;
}
print $cnt;