copy substr in existing string in Perl

Any clue to write something to a particular location in Perl?

Suppose

$line = �abc cde 1234�

How to write ( example string "test") on location 4 without parsing the whole line.

Output should be $line = �abctest 1234�

this is not search and replace. just to add substring into some existing string.

thanks

Hi.

Welcome to the forum.

Look through perldoc -q string ... cheers, drl

Hopefully I'm not doing your school work for you:

$line = 'abc cde 1234';
substr $line,3,4,'test';
print $line;

Look up the substr() function for details

Thanks. I did it aleady