#!/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