in reply to howto replace part of a string

First pad out or trim the replacement text to 10 characters with pack,

$repl = pack 'A10', $repl;
then do the replacement with substr,
substr $str, 10, 10, $repl;
or,
substr($str, 10, 10) = $repl;
Thare are dozens of other ways to do it, and you don't need to pad or trim if that's not what you want.

After Compline,
Zaxo