http://qs321.pair.com?node_id=11114884


in reply to declaring lexical variables in shortest scope: performance?

Perl is not, never has been, and almost certainly never will be a "high performance" language. If you're really that concerned about saving every flop, your first move should not be to question where to put my, your first move should be to switch to a different language.

As long as you avoid the big mistakes like using inefficient algorithms, optimizing for correct operation and readability is generally going to be more than sufficient. Micro-optimizing things like the placement of variable declarations is almost never worth the effort, regardless of language, because the time you spend doing the optimization will generally be many, many orders of magnitude larger than the handful of microseconds that will actually be saved by the code speedup.