Look at
IPC::Run. If you don't really need to be interactive (that is, the input you're feeding in doesn't depend on the intermediate output of it... like prompts, and such), then just
run does what you want (very nicely DWIM). If you really need to script a back-and-forth with the co-process, then look at using the
pump interface with
IPC::Run.
------------
:Wq
Not an editor command: Wq