#!/usr/bin/perl use strict; use warnings; use Net::Ping; my $i = $ARGV[0] || -1; while(--$i){ my $p = Net::Ping->new(); my $host = int(rand(255)) . '.' . int(rand(255)) . '.' . int(rand(255)) . '.' . int(rand(255)); $p->ping($host) and print "\n$host lives!\n"; $p->close(); print "."; }