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"; -- David K. Wall [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]