#!/usr/bin/perl use strict; use Net::Telnet::Cisco;
my $infile = "input.txt"; # Cisco Device List my $username = "user"; # login username my $passwd = "passWord"; # login password
open (INFILE, "$infile") die "Can't open $infile $!";
while (my $ip=<INFILE>) { chomp $ip; my $t = Net::Telnet::Cisco->new (Timeout => 10, Input_log => "input.log"); $t->open($ip); $t->login($username, $passwd); $t->enable($passwd); $t->cmd('term length 0'); $t->cmd('sh ver'); # you can change the command sh ver to your command $t->close; }