my $cs = Net::Telnet::Cisco->new(Host => '123.123.123.123'); $cs->login('login', 'password'); my $DEBUG = 1; open( FI, $ciscomm_conf ) || die $!; my( @oks, @fails); while() { # remove newline chomp; # skip blank or comment lines next if m/^\s*#/ or m/^\s*$/; my $cmd = $_; $DEBUG && print "Sending $cmd\n"; my @cmd_output = $cs->cmd( String => $cmd,Timeout =>60 ); if ( @cmd_output ) { $DEBUG && print "Recv: @cmd_output\n"; push @oks, [ $cmd, \@cmd_output ]; } else { $DEBUG && print "ERR: " . $cs->errmsg . "\n"; push @fails, [ $cmd, $cs->errmsg ]; } } close FI; $cs->close; use Data::Dumper; print "OK\n", Dumper(\@oks); print "Fail\n", Dumper(\@fails);