> Hello, This problem only occurs on ONE PC only running Win NT4 sp6a with Perl build 631. my personal PC and few others around can not replicate this problem,
I am running the same OS sp level and perl build as the above PC. I have a PC on the network which I use to check connectivity to other nodes. > I have a text file containing node names, one node name per line. In total > approx 130. > "Exactly" 126th call to a ping function returns an error 'host126 Bad file > descriptor at pinglist.pl line xx.' > My workaround is to put host126 in the file twice, as on the second > attempt (127th call to ping) works fine, see example below. > .. > host125 > host126 > host126 <---- inserted as a temp workaround > host127 > ... > > My perl programs reads the file into a list. Then it loops through the > list one by one pinging each node. > My code goes like this. > > use Net::Ping; > use Time::HiRes qw( usleep gettimeofday tv_interval ); > open HOSTS2PING, $Hosts2Ping or die "Could not open $Hosts2Ping\n"; > my @Hosts = <HOSTS2PING>; > close HOSTS2PING; > foreach my $host (@Hosts){ > chomp $host; > $host =~ s/^\s+//; > $host =~ s/\s+$//; > if ($host eq '') {next;} > printf ("%4d: %13s ", $i++ , $host); > my $p = Net::Ping->new("icmp", 5, 10)||die "$!"; > $t0 = [gettimeofday]; > $IsReachble = $p->ping($host)||print "$host $!";#<--- error occurs > here! > $t1 = [gettimeofday]; > my $delay_ms = sprintf ("%dms",1000* tv_interval ($t0, $t1)); > $Node{$host} = "OK ".$delay_ms if $IsReachble; > $Node{$host} = "Down" if not $IsReachble; > $p->close(); > print "$Node{$host}\n"; > } > > Regards > Mark Zvolanek > +612 9227 0479 > _______________________________________________ Perl-Win32-Admin mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs