#!/usr/bin/perl

use Net::Ping;

my $host = shift || "127.0.0.1";
chomp($host);

print $host;

my $p = Net::Ping->new("icmp");

if ($p->ping($host)) {
  print "\t1\n";
} else {
  print "\t0\n";
}

$p->close();
