Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

Re: perl script to open vi editor

by jonadab (Parson)
on Sep 12, 2014 at 13:49 UTC ( #1100397=note: print w/replies, xml ) Need Help??

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:

  • Situation 1: All-Local
    Ok, I've got a system here running Debian stable (wheezy), and I'm running a Perl script out of /var/www/cgi-bin/blah/index.cgi, which gets form data from a web browser ( In certain situations, depending on the form data, I want the Perl script to launch vi in a terminal window (I'm using Putty, because I used to be a Windows user and got used to that) to edit a particular file, say, /var/www/blah-config. I've ensured that blah-config is owned by www-data and is chmod u+w. From my Perl cgi script, how can I launch a command in a terminal window, as the www user, displayed on a certain user's desktop? (I'm logged into KDE as a regular user, not as www.)
  • Situation 2: Single Server, Single Client
    Hi, I've got a web server, we'll call it george, and a desktop system, bob. I'm running a Perl script on the web server, which I access in a web browser on the client by going to http://george/foo/ There's a file on the server, /var/www/quu.txt, that I want the user on the desktop system (bob@bob) to be able to edit. He's a vi user, so he wants to edit the file in vi; but the desktop system, bob, is a Windows system and doesn't have vi installed. It does have Putty. vim is installed on george, of course, because that's a Debian system (squeeze). Unfortunately, for arcane reasons beyond my control, the firewall between the two systems won't allow ssh traffic, only http. How can I work around this? Can I use a combination of Perl on the server and Putty on the client to edit the file via http somehow?
  • Situation 3: Single Web Server, Many Clients
    Hi, I have a web server, and we've got a website that has a lot of dynamic content, based on a Perl framework. (It's a sort of a game where you explore a dungeon and kill monsters.) Each user account has an associated config file, and because the config files can have comments and are kind of complex, we'd like to allow users to edit them in a text editor. Currently it's a plain textarea web form, but some of our users have played a similar game where the servers let them edit their config files in a vi editor, and they've been asking us for this feature. I asked them what browser they run the vi editor in, and they said it doesn't run in a browser, they use something called Putty for that. The cgi script, which has access to the browser cookie and session database, can determine which file the user is allowed to edit, but I need to know how to launch that in an editor so the remote user can edit it. Our users have a variety of systems, ranging from FreeBSD to Windows Eight. I think the one guy is even using something called VMS, whatever that is. Is there some cross-platform way we can make this work for our users?

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.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1100397]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2022-12-04 19:22 GMT
Find Nodes?
    Voting Booth?

    No recent polls found