develooper Front page | perl.beginners | Postings from February 2002

Trouble with Net::Ping

Thread Previous | Thread Next
From:
Joseph Bajin
Date:
February 27, 2002 08:42
Subject:
Trouble with Net::Ping
Message ID:
3C7D0C7D.6050204@aol.com
 I am appearing to have some
troubles. Here is what I have for my code:



#!/usr/bin/perl -w
use strict;
use Net::Ping;

################Initalize Variables#####################
my @hosts= qw(au);
my $t;
my @lines;
my $hostname;
my %status;

#while(1){

        $t = Net::Ping->new();
    foreach $hostname (@hosts) {
    if ($t->ping("ad.$hostname.doubleclick.net") ) {
            $status{$hostname} = " is alive.\n";
            print "This connection is alive.\n";
            }else {
               $status{$hostname} = "<font color=red><B>*** NOT PINGABLE!!
PLEASE CHECK!!***\n</b></font>";
            print "Thing connection is have problems.";
        }
            $t->close();
    }

    &emailstatus(%status)
    
    
    ....
    
    The code goes on and I know that works but this part is where I am 
having
the troubles. Can someone maybe point me in the right direction.
    
    Thanks,
    
    Joseph Bajin
Associate Systems Administrator


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About