#!/usr/bin/perl use strict; use warnings; my @array = (1..10); for (1..100) { my $rand_index = $array[rand($#array)+1]; print "$rand_index\n"; }