Problems? Is your data what you think it is? | |
PerlMonks |
Re: declaring lexical variables in shortest scope: performance?by LanX (Saint) |
on Mar 31, 2020 at 11:38 UTC ( [id://11114846]=note: print w/replies, xml ) | Need Help?? |
In general:
Your example with a for loop is a bit unfortunate, because aliasing is complicating things considerably. Together with various optimizations performance gains or loses should be unpredictable, especially between different versions of Perl. So benchmark it, I don't think it's worth the effort. °) BTW, for many years it was commonplace that private variables are faster, not sure if accessing package variables has been optimized in the mean time. ...
Cheers Rolf
In Section
Seekers of Perl Wisdom
|
|