Why do you have this line in your code?
if(my $y >= 1){
Other than that, there is little to improve your code. I would sort the list first, and stop looking at the list elements once I've found the first element that is greater than my target $y, but that's it.
In reply to Re: Calculated % of data greater than $x in an array
by Corion
in thread Calculated % of data greater than $x in an array
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |