David Wall wrote: > Chris <[EMAIL PROTECTED]> wrote on 21 Feb 2002: > > >>if ( substr(@result[$Pcount],0, 12) == ' Packets:' ) { >> > > How about > > if ( substr($result[$Pcount],0, 12) eq ' Packets:' ) { > > $result[$Pcount] is a scalar, not an array. > > or > > if ( $result[$Pcount] =~ /^\s+Packets:/ ) { > > > > But I think it's easier to use Net::Ping. > > > use strict; > use warnings; > use Net::Ping; > my $p = Net::Ping->new('icmp'); # see docs for available protocols > my $count = 0; > for (1..4) { ++$count if $p->ping("dns.host.example") } > print "4 pings, $count were successful\n"; > >
Not sure if the Net::Ping will give me what I really need... What you saw is a VERY small part of the program, and all I wanted to do was give some realistic status, visually, "realtime". It is all being logged to a file, and that output MUST be exactly like standard PING output. Thus, as I was tasked to keep it within "I can read this because this is what I am used to seeing" guidelines, I system commanded it out! :) But I will keep it in mind, for the future... :) -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]