#!/bin/perl use Net::Telnet::Cisco; $router = "10.10.10.4"; $port = 23; my $cs = Net::Telnet::Cisco->new( Host => $router, Input_log => "Input22.log", Port => $port,); $cs->login( 'cisco', 'cisco' ); $password="cisco123"; $cs->enable( $password ); open(OUTPUT, "> $ARGV[1]") or die "ERROR opening $ARGV[1]: $!n"; open(PREFIXES, "< $ARGV[0]") or die "ERROR opening $ARGV[0]: $!n"; open(ASFILE, "< asnames.txt") or warn "Can not open asnames.txt: $!n"; while () { /AS(d+?) (.*)/; $as{$1} = "$2"; } close(ASFILE); $path_num = 0; @cmd_output = $cs->cmd( 'term len 0' ); while () { chomp; if (!/^#/) { $prefix = $_; @cmd_output = $cs->cmd( "sh ip bgp $prefix" ); foreach (@cmd_output) { chomp;