in reply to Re: how to get the number of times a pattern matched
in thread how to get the number of times a pattern matched

Not quite. Assigning to a scalar puts the regex into scalar context, which causes it to return a 1 if there's any matches, or 0 otherwise.

You need:

my $count = () = $text =~ /g/g;
   MeowChow                                   
               s aamecha.s a..a\u$&owag.print