in reply to foreach to for (related to my last question)
Later you delete from the hash %SEQ.my $seq=(keys %SEQ)[$j] <--- missing semicolon
Question: What will (keys %SEQ)[$j] return the next time?
Answer: (this space intentionally filled with nonsense)
If you want to iterate over the keys of a hash, get a list of them and iterate over this list:
for(my $i=1; $i<@aas; $i++){ my $aa = $aas[$i]; @codons = @{$Deg_codons{$aa}}; my @SEQ = keys %SEQ; my $s = scalar @SEQ; for(my $j=0;$j<$s;$j++){ my $seq=@SEQ[$j]; foreach my $codon(@codons){ $SEQ{$seq.$codon}=1; $j++; $s++; } delete $SEQ{$seq}; $j--; $s--; } }
_($_=" "x(1<<5)."?\n".q·/)Oo. G°\ /
/\_¯/(q /
---------------------------- \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
|
|---|