in reply to text editor in perl.

I want to create an text editor in perl. Is there any way of doing it?

Sure, it has been done before.

That one is under GPL, source available. So you have ample opportunity to study how it can be done.