in reply to perlkhan 77
In addition to the earlier comments, I'd suggest changing (as an example)
to$count_G = ( $seq =~ tr/G//); $ratio_G = ($count_G/$len); # print "\n$ratio_G\n";
Writing the sub Calculate is left as an exercise to the reader. The advantages are you$ratio_G = Calculate( 'G' );
- get rid of all of the temporary $count_* variables
- remove duplicated code
- make future changes (e.g. you want percentage rather than ratio) more centralized
- make the intentions of your code much clearer
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: perlkhan 77
by Anonymous Monk on Apr 22, 2009 at 12:10 UTC | |
by Anonymous Monk on Apr 22, 2009 at 12:34 UTC |
In Section
Seekers of Perl Wisdom