in reply to Re^8: Write code diferently (A little knowledge is a dangerous thing.)
in thread Write code diferently

I am sorry that I made an error

Thank you, and respect.

Here are 3 runs each of 5.10.1 (my default installation) and 5.18.0 (self-compiled with MSVC VS v9.0) both running under Vista + SP1 on my hardware:

C:\test>IdiotsBench.pl Rate idiomatic-my-sub map-my-scope-sub idiomatic-my-sub 10817/s -- -7% map-my-scope-sub 11597/s 7% -- C:\test>IdiotsBench.pl Rate idiomatic-my-sub map-my-scope-sub idiomatic-my-sub 11113/s -- -8% map-my-scope-sub 12126/s 9% -- C:\test>IdiotsBench.pl Rate idiomatic-my-sub map-my-scope-sub idiomatic-my-sub 10760/s -- -11% map-my-scope-sub 12126/s 13% -- C:\test>\perl5.18\bin\perl.exe IdiotsBench.pl Rate map-my-scope-sub idiomatic-my-sub map-my-scope-sub 10426/s -- -9% idiomatic-my-sub 11438/s 10% -- C:\test>\perl5.18\bin\perl.exe IdiotsBench.pl Rate map-my-scope-sub idiomatic-my-sub map-my-scope-sub 10455/s -- -7% idiomatic-my-sub 11269/s 8% -- C:\test>\perl5.18\bin\perl.exe IdiotsBench.pl Rate map-my-scope-sub idiomatic-my-sub map-my-scope-sub 10521/s -- -7% idiomatic-my-sub 11263/s 7% --

So yes, the balance of power has shifted slightly.

my initial point has never been about performance anyway, but only to suggest a possible explanation for the OP's original question.

Which I understood to be so. But, there is no logical reason for denigrating the use of map in a void context.

Your argument for clarity -- an argument that is very close to my heart -- is false also; because it relies upon the assumption, or presumption, that map *must* return a list; rather than just 'applies a function to a list'.

You are (relatively) new around here; and I urge you to read and digest the writings of Abigail/Abigail-II, there is little that s/he said on the subject of Perl that isn't worthy if serious note.


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
  • Comment on Re^9: Write code diferently (A little knowledge is a dangerous thing.)
  • Download Code