Wiggins d'Anconia wrote:
Your benchmark isn't controlled. In the first instance you are doing a ++ on what amounts to a scalar getting autovivified, in the second instance you are assigning a pair of values to a list then autovivifying it. It isn't necessarily the map vs. foreach that is causing your difference. I think for your benchmark to be accurate you are going to have to control the actions taken in the loop, otherwise they affect the accuracy of your benchmark.
mm this may be true, but realistically, that is how I'd write them in code I actually use -- so it behooves me to test them the way I'd normally be using them.. not under artificial circumstances in ways I normally wouldn't write code.
I see what you're saying and it makes sense, but in this instance I'm more interested in seeing the results of the idiomatic expression of the end result. :)
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>