note
jonadab
<p>You may notice that you're getting some pretty vague answers, not all of which are really helpful. There's a reason.</p>
<p>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.
</p>
<p>To illustrate, I'm going to make up three <strong>very different</strong> 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:</p>
<ul>
<li><div><strong>Situation 1: All-Local</strong></div>
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 (http://127.0.0.1/cgi-bin/blah/).
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.)
</li>
<li><div><strong>Situation 2: Single Server, Single Client</strong></div>
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/quu.pl
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?
</li>
<li><div><strong>Situation 3: Single Web Server, Many Clients</strong></div>
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?</li>
</ul>
<p>The answers to these three questions would be <em>totally
completely <u>different</u></em>. 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.
</p>
1100355
1100355