sub count { my ($string,@array) = @_ ; # count recurrence of $string in @array return scalar grep $_ eq $string, @array ; }