in reply to Re: Top and bottom 10 percent elements of an array
in thread Top and bottom 10 percent elements of an array
should be$_->[1] = "B" for @sort_a_pos[0 .. $pct]; $_->[1] = "-" for @sort_a_pos[$pct+1 .. $#array-$pct-1]; $_->[1] = "A" for @sort_a_pos[$#array-$pct .. $#array];
$_->[1] = "B" for @sort_a_pos[0 .. $pct-1]; $_->[1] = "-" for @sort_a_pos[$pct .. $#array-$pct-1]; $_->[1] = "A" for @sort_a_pos[$#array-$pct .. $#array];
You probably got confused (like me) by the OP's weird math of 10 * 10% = 2. The output he gave was for 20%.
|
---|