use Data::Random qw(:all); my @random_chars = rand_chars( set => 'numeric', min => 10, max => 10 ); foreach (@random_chars) {print "$_\n";}