Nobody so far has mentioned your /g option on the regular expression check. If you're just looking for a yes/no on each line, then you can drop the /g. If you want to count multiple occurrences in the same line (such as 'l's in 'hello wally') then you will need to do something like catch m/.../g into an array, then count those elements.
--
[ e d @ h a l l e y . c c ]