maderman has asked for the wisdom of the Perl Monks concerning the following question:
The returned result is line: 1. From the dump_log (see below), it looks like my command is getting passed, but why am I getting a "1" instead of 1-DEC-2001 01:23:33? It doesn't matter if I put $line = $telnet->print('sh time') - scalar reference, or @line = $telnet->print('sh time') - array reference. I still get a "1". Many thanks.use Net::Telnet; use strict; my($telnet, $timeout, $command, @line); my $name = 'user'; my $passwd = 'password'; my $host = 'host'; $timeout = 900; $telnet = Net::Telnet->new( Prompt => '/prompt\$/', Dump_Log => 'dump.log', Input_Log => 'input.log', Output_Log => "output.log", Host => $host, Timeout => $timeout, ); $telnet->login(Name => $name, Password => $passwd, Prompt => '/prompt\$/' ); @line = $telnet->print('sh time'); $telnet->waitfor('/prompt\$/'); $telnet->print("lo"); #logout $telnet->close;
> 0x00000: 73 68 20 74 69 6d 65 0d 0a sh time.. < 0x00000: 73 68 20 74 69 6d 65 0d 0a sh time.. < 0x00000: 0d 00 20 20 20 31 2d 44 45 43 2d 32 30 30 31 20 .. 1- +DEC-2001 01:23:33.....host$ > 0x00000: 6c 6f 0d 0a lo.. 00000: 6c 6f 0d 0a lo..
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(jeffa) Re: Net:Telnet and Vaxes
by jeffa (Bishop) on Nov 30, 2001 at 21:11 UTC | |
|
Re: Net:Telnet and Vaxes
by jlongino (Parson) on Nov 30, 2001 at 22:09 UTC | |
|
Re: Net:Telnet and Vaxes
by davis (Vicar) on Nov 30, 2001 at 21:17 UTC | |
by maderman (Beadle) on Nov 30, 2001 at 22:14 UTC |