in reply to howto replace part of a string
First pad out or trim the replacement text to 10 characters with pack,
then do the replacement with substr,$repl = pack 'A10', $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.substr($str, 10, 10) = $repl;
After Compline,
Zaxo
|
|---|