in reply to perl script to open vi editor

You may notice that you're getting some pretty vague answers, not all of which are really helpful. There's a reason.

Generally speaking, Perlmonks is a friendly and helpful community, but that comes with a minor caveat: a lot of the people here are technically minded. To get useful information out of technically-minded people, you have to give them the technical information that they need in order to understand your question. You haven't done that.

To illustrate, I'm going to make up three very different situations and supply samples of how you could ask your question. I don't know if any of these three corresponds to your actual situation, because you haven't given us enough info to tell the difference. So you can think of these as examples:

The answers to these three questions would be totally completely different. And we can't tell which question you're asking, or even whether ANY of these questions are the question you're asking. You need to be much more specific about your situation, so we can understand what you are trying to do.