#/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";
}
相关文章
- perl sub
- Python 与 Perl的优缺点
- 硝烟中的JIRA和敏捷开发(二)-“ActiveSprint”中story无法显示子任务sub-task
- Centos中 安装 perl, m4, autoconf,automake
- Websocket 中的 sub-protocol 和 extensions 的关系
- IDEA IntelliJ如何配置Perl的运行环境
- Perl的调试方法 Eclipse+EPIC+PadWalker http://www.cnblogs.com/spriteflk/p/5726671.html
- Perl之Spreadsheet::WriteExcel安装
- 亚像素Sub Pixel
- VBS基础篇 - 过程(sub 与 Function)