|Perl Monk, Perl Meditation|
CGI to Telnet Interprocess Fun Stuffby Pedro Picasso (Sexton)
|on Aug 08, 2001 at 23:32 UTC||Need Help??|
Pedro Picasso has asked for the wisdom of the Perl Monks concerning the following question:
I'm doing a project for the big boss here at work. Basically he wants to access a telnettable machine somewhere and pass it commands from a cute looking web form.
i.e. I click the "Turn 'A' On" checkbox on a form and submit, and the CGI perl script telnets to the remote machine, passes the "turnon -function A" command, then gathers the output from that command to display on the returned HTML.
Thanks to the wonders of CGI and Net::Telnet, this works wonderfully, but slowly. Initiating a telnet session during every page load sucks even if I'm the only one using it.
What I'd like to do is have a Perl telnet program running a constant session and message it with I/O from my CGI script when the need arises.
Most of the interprocess tips that I read have to do with open(), exec(), and system(), but I need a way to have a constant session running instead of generating one all the time, and these don't help.
I've got one server running Apache mod_perl under NT, and another running it under RedHat, so I can do Unix/Win32 specific things if need be. I'd like to avoid writing my own Apache module unless it's absolutely necessary.
Help me Obi-Monks Kenobi. You're my only hope!
-the Pedro Picasso