in reply to Re: How do I insert, (not overwrite) into a string?
in thread How do I insert (not overwrite) into a string?

try this:
#!/usr/bin/perl use strict; sub insert_x_into_y_at_z { my ( $x, $y, $z) = @_; $y =~s/^(.{$z})/$1$x/; return $y; }