Drucal has asked for the wisdom of the Perl Monks concerning the following question:
##################################################!/c:\perl use warnings; use strict; use Net::Telnet; my $telnet = new Net::Telnet ( Timeout=>10, Errmode=>'die', Dump_Log=>'dump.txt', Input_log=>'input.txt', Output_log=>'output.txt', ); $telnet->open('172.16.233.214'); $telnet->waitfor('/username: $/i'); $telnet->print('myusername'); $telnet->waitfor('/password: $/i'); $telnet->print('mypassword'); my @lines; @lines = $telnet->cmd("vlan show"); #<----This is where it will hang. print @lines; @lines = $telnet->cmd("vlan"); print @lines;
############################################DB<2> s command timed-out at newtelnet.pl line 25 at C:/Perl/lib/Net/Telnet.pm line 2036 Net::Telnet::_croak('Net::Telnet=GLOB(0x1f0e89c)', 'command timed-out' +) called at C:/Perl/lib/Net/Telnet.pm line 539 Net::Telnet::error('Net::Telnet=GLOB(0x1f0e89c)', 'command timed-out') + c alled at C:/Perl/lib/Net/Telnet.pm line 361 Net::Telnet::cmd('Net::Telnet=GLOB(0x1f0e89c)', 'vlan show') called at + n ewtelnet.pl line 25 Net::Telnet::DESTROY(C:/Perl/lib/Net/Telnet.pm:201): 201: sub DESTROY { DB<2> s IO::Handle::DESTROY(C:/Perl/lib/IO/Handle.pm:330): 330: sub DESTROY {} DB<2> s IO::Handle::DESTROY(C:/Perl/lib/IO/Handle.pm:330): 330: sub DESTROY {} DB<2> s IO::Handle::DESTROY(C:/Perl/lib/IO/Handle.pm:330): 330: sub DESTROY {} DB<2> s Debugged program terminated. Use q to quit or R to restart, use o inhibit_exit to avoid stopping after program termination, h q, h R or h o to get additional info.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Telnet.pm error
by spivey49 (Monk) on Aug 12, 2008 at 22:22 UTC | |
|
Re: Telnet.pm error
by Bloodnok (Vicar) on Aug 13, 2008 at 10:50 UTC | |
by Anonymous Monk on Aug 13, 2008 at 16:14 UTC |