in reply to calling on files to execute remotely
Hope this helps.use Net::Telnet (); my $tn = Net::Telnet->new(Timeout => 15, Prompt => '/host:\/home\/dir\ +>/'); my $host = 'some.host.xxx'; my $login = 'test'; my $passwd = 'testpw'; $tn->open($host); $tn->login($login, $passwd); my $msg = $tn->errmsg; if ($msg) { print "A system error was generated on the login attempt:\n"; print " '$msg'\n\n"; } my @list = $tn->cmd("./prog.p"); my $msg = $tn->errmsg; if ($msg) { print "A error occurred when attempting remote cmd './prog.p':\n"; print " '$msg'\n\n"; } my $ok = $tn->close; if (not $ok) { print "\nUnable to close Telnet connection to HOST: $host\n\n"; exit; }
If the code and the comments disagree, then both are probably wrong. -- Norm Schryer
|
|---|