Rate split1 substr1 subst subst_inplace split1 2.93/s -- -72% -100% -100% substr1 10.3/s 253% -- -99% -99% subst 901/s 30682% 8623% -- -24% subst_inplace 1179/s 40176% 11313% 31% -- ok 1 ok 2 ok 3 1..3 #### sub subst_inplace { my ($s1, $s2) = @_; use bytes; $$s1 =~ s/(\0)/substr $s2, $+[0]-1, 1/eg; }