my $number_of_positions = 10; my @positions = (1..200); map {$arry[splice(@positions, rand(@positions, 1)] = 15;} (1..$number_of_positions);