http://www.perlmonks.org?node_id=655635


in reply to Counting matches.

Use intermediate list context:
print (($counter = () = /a/g) >= 3 ? 'more' : 'less');