Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Re: Re: Re: Idiomatic optimizations

by Joost (Canon)
on May 01, 2002 at 08:29 UTC ( #163221=note: print w/ replies, xml ) Need Help??


in reply to Re: Re: Re: Idiomatic optimizations
in thread Idiomatic optimizations

Just a few remarks (though i've got a sneaking suspicion i'm correcting typos here):

> my $i ||=0 ;

here $i will always turn out to be 0 (because of the my operator), so my $i=0; is more efficient.

> $i?$i=1:$i=0;
How about $i=$i?1:0; - that's also a bit more readable. (at least to my eyes).

Joost.


Comment on Re: Re: Re: Re: Idiomatic optimizations
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://163221]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (5)
As of 2015-07-03 16:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (54 votes), past polls