Randomseq code 1

From Biolecture.org
Revision as of 08:23, 7 December 2018 by imported>Na kyung Jung (Created page with "<p>Because of my lack of coding ability, I couldn't solve the error</p> <p>#!/usr/bin/perl</p> <p>use 5.010;<br /> use strict;<br /> use warnings;<br /> use Scalar::Util qw...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Because of my lack of coding ability, I couldn't solve the error

#!/usr/bin/perl

use 5.010;
use strict;
use warnings;
use Scalar::Util qw(looks_like_number);
print "Enter the number of sequence you want!\n";
my $seqnum=<STDIN>;
chomp $seqnum;
my @chars=("A","T","G","C");
my @newstring={};
$newstring .= $chars[rand @chars] for 1..$seqnum;
print(@newstring);