in reply to Generating mulitple random strings of a set length

This could be one way to do it with less code.

#!/usr/bin/perl use warnings; use strict; my $DNA = "AACCGTTAATGGGCATCGATGCTATGCGAGCT"; my @rand = split("", $DNA); my $num = @rand; my $max = 5; my @word; for (my $i=0; $i<$max; $i++) { my $x = int(rand($num))-1; push @word, $rand[$x]; } print @word;

By setting the variable $max to the desired length of the out put string.<br/
Of course if you wanted to use the random word as a variable substitute the "print @word" with
my $ranWord = join("",@word); print $ranWord;

or something along those lines to create a variable from the array contents