>Have you ever wanted to count the number of matches of a patten?  s///g 
>returns the number of matches it finds.  m//g just returns 1 for matching.
>Counts can be made using s//$&/g but this is wastefull, or by putting some 
>counting loop round a m//g.  But this all seams rather messy. 

It's really much easier than all that:

    $count = () = $string =~ /pattern/g;

--tom

Reply via email to