I have a string
$a = aabbccddaaffddnnaa [download]
$a=~ s/^aa$/ee/ [download]
In reply to not able to replace the element in the middle of the string by lakshmikant