通过本文主要向大家介绍了perl 数组长度,perl 字符串长度,perl 获取数组长度,perl 求数组长度,perl 找不到指定路径等相关知识,希望对您有所帮助,也希望大家支持linkedu.com www.linkedu.com
use strict;
use warnings;
#进行定义
my @dna;
my $dna_length;
my $newbase;
my $i=0;
print "please input the DNA length\n";
chomp($dna_length=<>);
while($i<$dna_length)
{
#从四个碱基中随机选取一个
my(@nucleotides)=qw/A T G C/;
$newbase=$nucleotides[rand @nucleotides];
#将随机生成的序列添加到@dna的数组中
push(@dna,$newbase);
++$i;
}
print "@dna";
</div>

