http://qs1969.pair.com?node_id=544056


in reply to "map" sometimes uses only the last mapped value

It seems to have to do with returning a temp from inside a for loop. It's not just stringify, here:
print map sub{return $_ for 0+shift}->($_), 1, 2, 3; # 333 print map sub{return $_ for shift}->($_), 1, 2, 3; # 123 print map sub{return 0+shift}->($_), 1, 2, 3; # 123 print map sub{return 0+$_ for shift}->($_), 1, 2, 3; # 123
Only the first of these cases messes up, funny

Replies are listed 'Best First'.
Re^2: "map" sometimes uses only the last mapped value
by xmath (Hermit) on Apr 18, 2006 at 12:56 UTC
    That was my post, forgot to log in. Sorry :-)