R. Joseph Newton wrote:

> "Bakken, Luke" wrote:
> 
>> > $!=1;
>>
>> $! contains error text, if I remember correctly off the top of my head.
>>
>> Use $| = 1 instead for autoflush. This shouldn't cause redirect
>> problems, tho.
>>
>> > use Net::Ping;
>> > @host_array = <DATA>;
>> > $p = Net::Ping->new("icmp");
>> > $p->bind("192.168.2.211"); # Specify source interface of pings
>> > foreach $host (@host_array)  {
>> >    chomp($host);
>> >    print "$host is ";
>> >    print "NOT " unless $p->ping($host, 2);
>> >    print "reachable.\n";
>> > }
>> > $p->close();
>>
>> Are you running this on Windows? I've noticed redirect weirdness with
>> Windows at times.
>>
>> Otherwise everything looks OK.
>>
>> Luke
> 
> Hi Luke,
> 
> FWIW, Rob's speculation hit the mark.  Neither setting the error message
> to '1', nor output redirection problems seem to hang it, at least on
> Win2K.  I think it probably would be better to quote the entire parameter
> list for perl, but it did run fine once the call to the non-existent
> bind() function was commented out.

non-existent? since when? 

perldoc Net::Ping

       $p->bind($local_addr);
           Sets the source address from which pings will be sent.  This must
           be the address of one of the interfaces on the local host.
           $local_addr may be specified as a hostname or as a text IP 
           address such as "192.168.1.1".

           If the protocol is set to "tcp", this method may be called any 
           number of times, and each call to the ping() method (below) will 
           use the most recent $local_addr.  If the protocol is "icmp" or 
           "udp", then bind() must be called at most once per object, and 
           (if it is called at all) must be called before the first call to 
           ping() for that object.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to