codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  running a command in remote machine by using perl  bharathgannu at 07:16 on Wednesday, April 28, 2010
 

Hi All,

I'm using following code to connect to a remote machine and try to execute one simple command on remote machine.

cat tt.pl

#!/usr/bin/perl

#use strict;

use warnings;

use Net::Telnet;

$telnet = new Net::Telnet ( Timeout=>2, Errmode=>'die');

$telnet->open('172.168.12.58');

$telnet->waitfor('/login:\s*/');

$telnet->print('admin');

$telnet->waitfor('/password:\s*/');

$telnet->print('Blue');

#$telnet->cmd('/forum/ver_gt_Clog.txt');

$telnet->cmd('mkdir gy');

You have new mail in /var/spool/mail/root

[root@localhost]#

But when i'm executing this script it is throwing error messages

[root@localhost]# perl tt.pl

command timed-out at tt.pl line 12

[root@localhost]#

Please help me in this








CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums








Recent Forum Threads
•  Re: Need some help with javascript code in Unity!
•  Re: Copy files from one directory to another in a local network
•  Re: number of hours and minutes spent
•  Re: Saving a Picture or Image contained within a Picturebox into Windows Registry
•  Join Apache Lucene EuroCon 2010
•  FREE dating software worth over $350 for free
•  FREE dating software worth over $350 for free
•  running a command in remote machine by using perl
•  converting JAVA code to JSP


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2010