What is the best way to count how many times the word "foo" occurs in @array?If you only want to count occurances, use grep in scalar context
my $count_foo = grep (/foo/, @array);
In reply to Re: Word frequency in an array
by FunkyMonk
in thread Word frequency in an array
by monkeybus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |