P is for Practical | |
PerlMonks |
Re^3: Coding styleby ruzam (Curate) |
on Jul 13, 2010 at 14:14 UTC ( [id://849275]=note: print w/replies, xml ) | Need Help?? |
When I need to speed up code I go looking for nested hash references as in your example. It's my believe the cost of creating a new variable is small(er) compared to the cost of looking up the value of a nested reference. If the same value is referenced more than once, it's worth creating a variable to skip as much dereferencing as you can.
The fact that it's more readable is just a bonus.
In Section
Seekers of Perl Wisdom
|
|