#/usr/bin/perl -w
use strict;
my $usage = "\n\nusage: $0 <length>\n\n";
my $length = $ARGV[0] || die $usage;
&RandomSeq($ARGV[0]); # invoke the subroutine
sub RandomSeq {
for (my $i = 0; $i < $length; $i++) {
unless ($i%70) {print "\n"};
my $base = int(rand(4));
if ($base == 0) {print "A"; next;}
if ($base == 1) {print "C"; next;}
if ($base == 2) {print "T"; next;}
if ($base == 3) {print "G"; next;}
}
print "\n";
}
相关文章
- 10-14$Super$$ 和 $Sub$$ 的使用
- 10-14Little Sub and Mr.Potato's Math Problem-构造
- 10-14OpenCL的buffer以及sub-buffer
- 10-14如何为使用fastcgi和perlbrew在Nginx上运行的Perl催化剂应用程序创建初始化脚本
- 10-14Dynamics CRM2013 sub grid中数据翻页问题
- 10-14HTML行内元素标签:b、strong、i、u、del、sub、sup
- 10-14一文搞懂 deconvolution、transposed convolution、sub-pixel or fractional convolution
- 10-14从fortran调用c sub时运行时间中止
- 10-14git sub module使用注意
- 10-14关联子查询 correlated sub-queries