#!/usr/bin/perl -w use strict; use Net::Telnet(); # ... # ... sub checkVersion { my $host = shift; my $telnet = new Net::Telnet(Timeout => 10, Prompt => '/-> $/', Errmode => "return"); if ( not $telnet->open($host) ){ # Telnet timeout for destination print "Telnet failed for address $host.\n"; $telnet->close; return 0; } # ... } for ( my $i = $ip_range_start; $i <= $ip_range_stop; $i++) { $host = "$ip_c_base.$i"; checkVersion($host); }
In reply to Net::Telnet timeout fails by JykkeDaMan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |