in reply to Re: Word frequency in an array
in thread Word frequency in an array

Lets use that in an example...
my @array = qw(foo bar food foofighters kung-foo); my $count_foo = grep (/foo/, @array); print "$count_foo\n";
Prints "4" - which may or may not be what the OP was after (I suspect not).
my $count_foo = grep { $_ eq 'foo' } @array;
..might be more what the OP was looking for.

Cheers,
Darren :)