Telnet from perl

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

I use this NET::TELNET module to login into a telnet session.. THis is
the code

use CGI;

$frm = new CGI;

$unix_box = $frm->param('unix_box');

$username = $frm->param('username');

$password = $frm->param('password');

#$unix_box = "";

#$username = "xxxxxx";

#$password = "xxxxxxxx";

my $prmpt = '/[\w().-]*[$#>:.]\s?(?:\(enable\))?\s*$/';
$telnet = new Net::Telnet ( Timeout=>20, Prompt => $prmpt,
"Dump_log"   => "dump_log",  
use Net::Telnet;
$telnet->waitfor('/Enter SecurID PASSCODE:/i');
@lines= $telnet->cmd("who");
#print STDOUT @lines;

print "Content-type: text/html\n\n";

print "


When i run this script from the command line it works fine. But when i
run this as a post from a form with values for username,password and
unix box it does not work.

Please advise


Site Timeline