#!/usr/bin/env perl use strict; use warnings; for my $dest ('www.google.com', 'www.perlmonks.org', 'microsoft.com', 'foo.bar') { system ("ping -nqc1 -w 3 -W 3 $dest > /tmp/ping.log") and print "### $dest is unreachable\n"; }