in reply to Re^2: Surprised by join
in thread Surprised by join

Somewhere else in this thread $a and $b were mentioned. The snippet above could be changed to use this. Instead of

$res .= $sub->($_[$i-1], $_[$i]) . $_[$i];

it would be

local $a = $_[$i-1]; local $b = $_[$i]; $res .= $sub->() . $_[$i];
(Untested)