Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Using the Net::Telnet package to develop with telnet ,everything looks great, example:
#!/usr/bin/perl
use strict;
use Net::Telnet;
my $telnet=Net::Telnet->new(Timeout => 5,Prompt
=> '/.+>/',Host => "1.1.1.1");$telnet->login('cisco','cisco');
my @res=$telnet->cmd('show version');
print @res;
But now, the story is, I'm not allowed to use any CPAN packages, just pure perl to implement the same function -- given the IP username and password, simple command and then return the result (like example shown above), and what's more, the perl script need run well in windows (activeperl) as well as in linux.
Thanks for any help in advance ^_^
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: perl+telnet(with out Net::Telnet)
by marto (Cardinal) on Jul 14, 2010 at 10:16 UTC | |
|
Re: perl+telnet(with out Net::Telnet)
by rovf (Priest) on Jul 14, 2010 at 10:51 UTC | |
by marto (Cardinal) on Jul 14, 2010 at 11:22 UTC | |
by rovf (Priest) on Jul 14, 2010 at 13:57 UTC |