in reply to Can I condense the variable usage here?

Um, how about just using Net::DNS instead? From the EXAMPLES section:
use Net::DNS; my $res = Net::DNS::Resolver->new; my $query = $res->search("host.example.com"); if ($query) { foreach my $rr ($query->answer) { next unless $rr->type eq "A"; print $rr->address, "\n"; } } else { warn "query failed: ", $res->errorstring, "\n"; }

jeffa

L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(the triplet paradiddle with high-hat)

Replies are listed 'Best First'.
Re: Re: Can I condense the variable usage here?
by Ninthwave (Chaplain) on Dec 23, 2003 at 16:09 UTC

    I am on a Win32 machine for now. And Net::DNS is a bit buggy on Win32 from the link you sent. But to explain it more clearly. I have a range of IP addresses that are pinged to see what live machines are on the network. I then look up from a live ip the host name. I need to get the computer name from computer_name.company.com but sometimes our dns/dhcp systems resolves to a name of computer_name-udp12345678.company.com

    "No matter where you go, there you are." BB