http://www.perlmonks.org?node_id=1008164


in reply to Problems with map(function, array)

works for me:

DB<121> sub add { $_ + $_[0] } DB<122> map add(2), 1..3 => (3, 4, 5)

> Surprisingly, my new function sometimes works, and sometimes not. Here's the output from that second code fragment:

No surprise, you're deleting @a in the process, please repeat your experiments always with freshly reinitialized input.

Cheers Rolf