while() { chomp; if (/^Received:[^\[]+\[(\d+)\.(\d+)\.(\d+)\.(\d+)\]/) { $n=`host $4.$3.$2.$1.$ARGV[0] 2>&1`; exit(0) if ($n=~/$ARGV[1]/m); } } exit(1);