By the way, your first snippet simplifies to
sub get_all_seqs{ my $protein = shift; #print "protein = $protein\n"; my @aas = split(//, $protein); my %Deg_codons = get_degenerate(); my @codons = @{$Deg_codons{$aas[0]}}; my %SEQ = map { $_ => 1 } @codons; foreach my $aa (@aas[1..$#aas]) { foreach my $seq (keys %SEQ) { foreach my $codon (@codons) { $SEQ{$seq.$codon} = 1; } delete $SEQ{$seq}; } } return sort keys %SEQ; }
In reply to Re: foreach to for (related to my last question)
by ikegami
in thread foreach to for (related to my last question)
by tricolaire
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |