in reply to How Perl Optimize your code & some code TIPS ;-P

Well, if you put the my inside, you set the my, write the variable, run the code, than clean the variable to recreate it in the next loop. If you put outside, you create it only 1 time, than only write to the variable, and this use less CPU.
Depends — oftentimes I need the variable to be undefined at the start of the loop. In that case, I would have to do
my $var; while( $foo ) { # ... undef $var; }
Also, I try to scope very tightly for reasons beyond memory reuse — if you declare a variable inside a block, it's obvious that it's meant strictly for use inside that block. That would be
{ my $var; while( $foo ) { # ... } }

Both workarounds are kludgy and make the code harder to read — and easy to read code is my #2 priority. Efficiency is only my #3 or #4 priority — unless I really need the speed, and have profiled and benchmarked my code and identified the piece of code in question as the hotspot. (#1 is correctly working code, if you were wondering.)

This does not of course affect advice such as smart ordering of conditions as that only rarely makes a difference with readability.

Makeshifts last the longest.