Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Idiomatic optimizations

by jlongino (Parson)
on Apr 29, 2002 at 17:45 UTC ( #162878=note: print w/ replies, xml ) Need Help??


in reply to Idiomatic optimizations

Most of the optimizations listed can be found in the "Other Oddments" chapter of the Camel in the section "Efficiency". But one of my favorites (also in the Camel, but paraphrased using $x/$y/$z instead of $a/$b/$c):

Use $foo = $x || $y || $z; This is much faster (and shorter to say) +than: if ($x) { $foo = $x; } elsif ($y) { $foo = $y; } elsif ($z) { $foo = $z; }

--Jim


Comment on Re: Idiomatic optimizations
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (8)
As of 2014-07-23 02:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (131 votes), past polls