http://www.perlmonks.org?node_id=872449


in reply to Piping data to vim

vim doesn't output the file to STDOUT, it outputs GUI instructions to talk to the presumed user. How to do it depends on whether you want to program or type the vim instructions. Either way you have to save the data to a file and then either shell out to vim (see the system function) or pipe the vim instructions terminated by "wq!\n" into vim (see the open function).

Either way the data then has to be read back from the file, not a pipe.

One world, one people