for (my $I=1; $I <= $n_dice; $I++){ $rolls [$I-1] = int(rand($n_sides))+1;