La Familia has asked for the wisdom of the Perl Monks concerning the following question:
If I can get guidance, criticism, or help on this and what I'm doing wrong, that will be very much appreciated. Thanks all, perl is my first computer language so I plan to stick with it.@sequences = (ATATGACTTG, GGGGATCCAC, ATACATATAC, AGGCTACGCT, GAGGCCGCGC); @list = sort GC @sequences; sub GC{ $count = 0; #keep count of g and c per sequence $index = 0; #cycle through each item in list for ($count = 0; { #Not sure, I've tried many things. if(g == $sequences{$index}) {$total = $count + 1} if(c == $sequences{$index}) {$total = $count + 1} $index++; return($a cmp $b); } } print join("\n", @list), "\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Help Manipulating Sort with Subroutines
by ikegami (Patriarch) on Dec 23, 2010 at 06:36 UTC | |
|
Re: Help Manipulating Sort with Subroutines
by Utilitarian (Vicar) on Dec 23, 2010 at 08:07 UTC | |
by La Familia (Initiate) on Dec 23, 2010 at 17:01 UTC |