I think you want "double piping" (not sure this term is correct), writing to and reading from the same program. One sceario is put the data on temporary file (which doesn't meet your reqs) and feed it the editor. You read the temporary file back after the editor finish its job. And you might want to delete the file as well at the end of your program. I do this with vim to build some semi-automatic cvs commit on many files at once with separate log changes for each file. Although vim is capable of reading from STDIN (no prior filename), I haven't incorporated this.
Another scenario requires that the editor is able to spit out the content it edits so the program can read the editor's output back to its data. I haven't done this before so instead of giving you example I refer you to IPC::Open2 and IPC::Open3 modules. They come with the Perl standard distribution.
Open source softwares? Share and enjoy. Make profit from them if you can. Yet, share and enjoy!