freelanceprogrammers.org Forum Index » Perl
Re: Problem with the NET::TELNET
Joined: 27 Jun 2005
Posts: 3
Re: Problem with the NET::TELNET
----- Original Message -----
From: "sid tow" <siddy_tow@...>
To: <perl_official@yahoogroups.com>
Sent: Saturday, June 25, 2005 4:40 PM
Subject: [Perl] Problem with the NET::TELNET
> Hi ALL
>
> I am facing a problem with the NET::TELNET module. I am telnetting to a
linux box and there I am trying to run perl script which actually is a
expect script. So now the problem is that when the perl expect script is
running remotely I am supposed to execute a command and wait for its
completion and then execute the next command when I get the prompt. The
problem is that I am not able to get the complete command execution and
hence the next prompt. I wonder what the problem is, is it like the telnet
window is smaller or the output buffer allocated to the telnet session
through the perl module is small. Can anyone explain.
> I have copied some part of the code I hope it helps you.
>
> windows pc telnet code
> $telnet_box->open("$host") ||
> die "Failed to connect to $host $!";
> $telnet_box->login($user_name, $password) ||
> die "Failed to log onto $host. The username or password is
wrong$!";
> @$lines = $telnet_box->cmd("perl expect_execute.pl");
>
> Linux box expect script code:
>
> $exp_inst->log_file("$templog", "w");
> $exp_inst->expect($timeout,
> [ `-re` , $prompt,
> sub {
> my $fh = shift;
> $fh->send("$command
");
> }
> ],
> [ timeout =>
> sub {
> my_die "unable to get the prompt $prompt";
> }
> ]
> );
>
> Output :
> prompt> command
>
>
> More ...
>
> Expected:
> prompt> command
> xyz
> yy
> prompt>
>
>
> Thanks in advance
>
>
> ---------------------------------
> Yahoo! Sports
> Rekindle the Rivalries. Sign up for Fantasy Football
>
> [Non-text portions of this message have been removed]
>
>
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
Joined: 27 Jun 2005
Posts: 3
Re: Problem with the NET::TELNET
----- Original Message -----
From: "sid tow" <siddy_tow@...>
To: <perl_official@yahoogroups.com>
Sent: Saturday, June 25, 2005 4:40 PM
Subject: [Perl] Problem with the NET::TELNET
> Hi ALL
>
> I am facing a problem with the NET::TELNET module. I am telnetting to a
linux box and there I am trying to run perl script which actually is a
expect script. So now the problem is that when the perl expect script is
running remotely I am supposed to execute a command and wait for its
completion and then execute the next command when I get the prompt. The
problem is that I am not able to get the complete command execution and
hence the next prompt. I wonder what the problem is, is it like the telnet
window is smaller or the output buffer allocated to the telnet session
through the perl module is small. Can anyone explain.
> I have copied some part of the code I hope it helps you.
>
> windows pc telnet code
> $telnet_box->open("$host") ||
> die "Failed to connect to $host $!";
> $telnet_box->login($user_name, $password) ||
> die "Failed to log onto $host. The username or password is
wrong$!";
> @$lines = $telnet_box->cmd("perl expect_execute.pl");
>
> Linux box expect script code:
>
> $exp_inst->log_file("$templog", "w");
> $exp_inst->expect($timeout,
> [ `-re` , $prompt,
> sub {
> my $fh = shift;
> $fh->send("$command
");
> }
> ],
> [ timeout =>
> sub {
> my_die "unable to get the prompt $prompt";
> }
> ]
> );
>
> Output :
> prompt> command
>
>
> More ...
>
> Expected:
> prompt> command
> xyz
> yy
> prompt>
>
>
> Thanks in advance
>
>
> ---------------------------------
> Yahoo! Sports
> Rekindle the Rivalries. Sign up for Fantasy Football
>
> [Non-text portions of this message have been removed]
>
>
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
Joined: 27 Jun 2005
Posts: 3
Re: Problem with the NET::TELNET
----- Original Message -----
From: "sid tow" <siddy_tow@...>
To: <perl_official@yahoogroups.com>
Sent: Saturday, June 25, 2005 4:40 PM
Subject: [Perl] Problem with the NET::TELNET
> Hi ALL
>
> I am facing a problem with the NET::TELNET module. I am telnetting to a
linux box and there I am trying to run perl script which actually is a
expect script. So now the problem is that when the perl expect script is
running remotely I am supposed to execute a command and wait for its
completion and then execute the next command when I get the prompt. The
problem is that I am not able to get the complete command execution and
hence the next prompt. I wonder what the problem is, is it like the telnet
window is smaller or the output buffer allocated to the telnet session
through the perl module is small. Can anyone explain.
> I have copied some part of the code I hope it helps you.
>
> windows pc telnet code
> $telnet_box->open("$host") ||
> die "Failed to connect to $host $!";
> $telnet_box->login($user_name, $password) ||
> die "Failed to log onto $host. The username or password is
wrong$!";
> @$lines = $telnet_box->cmd("perl expect_execute.pl");
>
> Linux box expect script code:
>
> $exp_inst->log_file("$templog", "w");
> $exp_inst->expect($timeout,
> [ `-re` , $prompt,
> sub {
> my $fh = shift;
> $fh->send("$command
");
> }
> ],
> [ timeout =>
> sub {
> my_die "unable to get the prompt $prompt";
> }
> ]
> );
>
> Output :
> prompt> command
>
>
> More ...
>
> Expected:
> prompt> command
> xyz
> yy
> prompt>
>
>
> Thanks in advance
>
>
> ---------------------------------
> Yahoo! Sports
> Rekindle the Rivalries. Sign up for Fantasy Football
>
> [Non-text portions of this message have been removed]
>
>
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
All times are GMT
Page 1 of 1
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Freelace Website Designer - Customer web design and software building.
China Wholesale - Electronics Products
Character Studio - Tutorials and Help
China Wholesale - Electronics Products
Character Studio - Tutorials and Help







