|
|
| Problems? Is your data what you think it is? | |
| PerlMonks |
Re: Two Questions on "my"by bobn (Chaplain) |
| on May 22, 2004 at 14:10 UTC ( [id://355601]=note: print w/replies, xml ) | Need Help?? |
This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.
I don't know where you get a 50% hit for the 'my' inside the for loop. When I do this:
I get: Changing the subs to: yields: SO the decision is really based on what it *should* be based on - is $foo intended to be used outside the loop, with the effects of the loop desired to be visible. If so, do it the first way. If not, do it the second way.
--Bob Niederman, http://bob-n.com All code given here is UNTESTED unless otherwise stated.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||