Telnet to multiple systems, continue on failure

Telnet to multiple systems, continue on failure

am 18.03.2006 01:10:30 von jason.wolford

I'm trying to telnet to multiple system IP address that I'm loading
from a file. However, if one of the telnet connections fails, the
scripts stops. I want it to continue trying to telnet to the rest of
the devices in the list even if connections fail. I'm fairly new at
this and any assistance would be helpful.

while (my $ip = ){


my $telnet = Net::Telnet->new(Host=>"$ip", Port=>'23')
$telnet->login("user","password");
$telnet->print('en');
$telnet->print('password');
$telnet->print("$set_serv_ip");
my @lines = $telnet->print("restart all");
print OUT @lines;


problem connecting to "10.1.2.127
", port 23: Unknown error at C:\server-change.pl line 53