I'd appreciate any comments on the code below. I run it like this:

    ./live <seed.dat

    or

    echo zaphod | ./live

To get a quick scan of the reachability of my routers.

Question: What is the proper way to include a version number in the
code? When I do a "perl -MCPAN -eshell" and type "r" for the reinstall
recommendations - many modules show the version. Looking at the code to
some of these modules it seems it uses the "vars" pragma. According to
perldoc - it's obsolete. What is the correct way to do this - or does it
even make a difference.

For those who might want to comment - here's the code... (be kind - I'm
new at this).

    ./live <seed.dat

#!/usr/bin/perl -w

use strict;
use warnings;
use Net::Ping;

my $p;
my $host;

our $VERSION = "0.01";

$p = Net::Ping->new("icmp");
foreach (<>)
{
        chomp;
        if ($_ eq "") {
                print STDERR "\nDone\n";
                exit(0);
        }
        print "$_ is ";
        print "NOT " unless $p->ping($_, 2);
        print "reachable.\n";
}
$p->close();




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

Reply via email to