GSperlbio has asked for the wisdom of the Perl Monks concerning the following question:
Im having sequence "CUGUACAGCCUCCUAGCUUUCC" in the file "rna.txt" i need to get the length of the sequence as 22 instead im getting 23. can anyone help me to correct this error?? this is my code:
#!usr/bin/perl use warnings; open (RH, "<rna.txt") || die "cant open the file"; my $arr2 = <RH>; print "rna sequence is $arr2"; $len2= length($arr2); print $len2;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: calculating length of the string
by Eily (Monsignor) on Jul 29, 2015 at 09:35 UTC | |
|
Re: calculating length of the string
by vinoth.ree (Monsignor) on Jul 29, 2015 at 09:50 UTC | |
by locked_user sundialsvc4 (Abbot) on Jul 29, 2015 at 13:09 UTC |