in reply to foreach to for
Word of advice, pick "for" or "foreach" and use one. Minor nit, but they're interchangable, and switching back and forth tends to make it less readable for me.
And just a quick note:
can be written more perlish as (assuming you really want elements 0 .. $#aas of @aas, instead of 1..$#aas+1):for( my $i=1; $i<@aas; $i++){ #etc }
for( @aas ){ @codons = @{$Deg_codons{$_}}; for my $seq( keys %SEQ ){ for my $codon( @codons ){ $SEQ{$seq.$codon}=1; } delete $SEQ{$seq}; } }
There are probably some other changes that could be made here, but these are just the ones that jump off the page at me.
$,=42;for(34,0,-3,9,-11,11,-17,7,-5){$*.=pack'c'=>$,+=$_}for(reverse s +plit//=>$* ){$%++?$ %%2?push@C,$_,$":push@c,$_,$":(push@C,$_,$")&&push@c,$"}$C[$# +C]=$/;($#C >$#c)?($ c=\@C)&&($ C=\@c):($ c=\@c)&&($C=\@C);$%=$|;for(@$c){print$_^ +$$C[$%++]}
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: foreach to for
by bart (Canon) on Jun 19, 2006 at 06:42 UTC | |
by dsheroh (Monsignor) on Jun 19, 2006 at 15:15 UTC |