If you just need a way to telnet from Perl, Net::Telnet works nicely. Here's a simple example that logs into my redback and prints out its version info.
#!/usr/bin/perl use Net::Telnet; use strict; my $hostname = "redback"; my $username = "admin"; my $passwd = "password"; # Instantiate the telnet object my $router = new Net::Telnet ( Prompt => '/.*>$/' ); # Open the connection $router->open($hostname); # Log in $router->login($username, $passwd); # Get some info my @version = $router->cmd('show version'); # Close the connection $router->close(); # Print the output print @version; # EOF
- Matt
In reply to Re:
by DrManhattan
in thread More IPC::Open2 stuff
by raflach
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |