It should be noted that '~~', the Smartmatch Operator, is experimental: see "perl5180delta: The smartmatch family of features are now experimental".
I haven't investigated whether it makes a difference with this specific usage; however, it may be worth checking this (from "perlop: Smartmatch Operator"):
"First available in Perl 5.10.1 (the 5.10.0 version behaved differently), ..."
-- Ken
In reply to Re: Answer: Count of words that match in an array
by kcott
in thread Count of words that match in an array
by Al Shiferaw
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |