use Time::HiRes qw( time ); $MDIR="/tmp/"; #save list into an array open(LIST, "$MDIR/list"); @list=; close LIST; @updevices=grep(!/known down|unmanaged/i,@list); my $start = Time::HiRes::gettimeofday(); foreach $element (@updevices) { #hostname:status:ip @ip = split(':',$element); system("ping $ip[2] 1 &"); $result = $?; print "ping $ip[0] $ip[2] $result\n"; if ( $result != 0) { print "$ip[0] is dead\n"; } } my $end = Time::HiRes::gettimeofday(); printf("%.2f\n", $end - $start);