P is for Practical | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
The Orcish Maneuver is a term coined by Joseph Hall in his book "Effective Perl Programming" (co-authored by merlyn). Here's the essence of it:
The "orcish" (a bad attempt at humor: "or cache") maneuver basically caches the results of an expensive lookup using the ||= operator. This operator says, in the above code, that $times{$a} will be evaluated or, if it is false, set it to the value of -M $a. (-M is the file test operator for last modified time). This allows you to cache the results of -M rather than call it every time. This has the same effect as:
Cheers, Join the Perlmonks Setiathome Group or just click on the the link and check out our stats. In reply to (Ovid) Re: Orcish Maneuver
by Ovid
|
|