> my $i ||=0 ;
here $i will always turn out to be 0 (because of the my operator), so my $i=0; is more efficient.
How about $i=$i?1:0; - that's also a bit more readable. (at least to my eyes).> $i?$i=1:$i=0;
Joost.
In reply to Re: Re: Re: Re: Idiomatic optimizations
by Joost
in thread Idiomatic optimizations
by Juerd
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |