in reply to Generating mulitple random strings of a set length
#!/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;
my $ranWord = join("",@word); print $ranWord;
|
|---|