You can loop through each element and add to a counter, like this:
#!/usr/bin/perl
use strict;
use warnings;
my @array = qw/ 1 2 3 4/;
my $lower = 0;
my $equal = 0;
my $higher = 0;
for my $i (@array)
{
if ($i < 2) { $lower += 1; }
elsif ($i == 2) { $equal += 1; }
else { $higher += 1; }
}
print "There are $lower elements lower than 2\n";
print "There are $equal elements equal to 2\n";
print "There are $higher elements higher than 2\n";