Hi, tnx McA i get it now ... i have put the eval in wrong place. Here is what iv done
eval { my $session = Net::Telnet::Cisco->new(Host => "$device", Input_log => "perllogrouter/router$i.log", ); $session->login(Password => $curpwd); if ($session->enable("$curpwd")) { # Execute a command @output = $session->cmd ('show running-config | section hostname') +; print "@output\n"; print " ======================================================\n"; } $session->close; }; if ($@) {print "Error: $@\n"}
before i was put the eval in "$seesion->login(password=>$curpwd);" , now its works fine ... tnx again for the help and support.
In reply to Re^2: Cisco Telnet
by mvip
in thread Cisco Telnet
by mvip
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |