Random nucleotide sequence

Martin CHAN chi-wai genix at cuhk.edu.hk
Mon Sep 23 09:55:41 EST 2002


> sub shuffle {
>   my $array = shift;
>   my $i;
>   for ($i = @$array; --$i; ) {
>     my $j = int rand ($i+1);
>     next if $i == $j;
>     @$array[$i,$j] = @$array[$j,$i];
>   }
> }


The sub shuffle can be replaced by the module Algorithm::Numerical::Shuffle




More information about the Methods mailing list