|
|
| The stupid question is the question not asked | |
| PerlMonks |
Re: Re: Re: Strange benchmark result that has me totally confoundedby chromatic (Archbishop) |
| on Apr 16, 2004 at 19:15 UTC ( [id://345903]=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.
As perldoc perlsyn says: In other words, the "foreach" loop index variable is an implicit alias for each item in the list that you're looping over. I don't think local will do it either; not unless you want an empty array or are doing something a lot more clever than I can imagine. You need to reset the values of the array for each benchmark iteration.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||