for my $address (@array) { my $output = `nslookup $address`; print $output; }