($min, $max) = (sort { $a <=> $b } @numset)[0,-1]; #### grep { $avg += $_/@numset } @numset;