#!/usr/bin/perl use strict; use warnings; my $y= 10; my @array =(1, 4, 5, 7, 8, 9, 10, 20, 30, 40, 60); my $greater = 50 ; my $num = scalar(@array); my $percent = (scalar(grep{$_ > $greater} @array)/$num)*100; print "Percent of \@array's $num items greater than $greater is $percent%\n"; exit(0);