|Do you know where your variables are?|
Net::DNS::Resolver and nameserversby henzen (Acolyte)
|on May 13, 2011 at 14:22 UTC||Need Help??|
henzen has asked for the wisdom of the Perl Monks concerning the following question:
I'm slow today for some reason - maybe too little coffee, and would appreciate some wisdom.
That's the usual usage, ie, hard coding the nameserver IPs. I want to use a variable such as @nameservers (or even the scalar $nameservers):
This works, but it only queries the first nameserver. The remainder are ignored (so it fails if the first NS is dead).
I cannot hard-code as $ns = qw(ip1 ip2 ip3 ip4), since the IPs are sourced from another variable and qw() doesn't interpolate (so I cannot do $ns = qw($ip1 $ip2 $ip3 $ip4))...
I just need to programmatically pass several nameserver IPs to Net::DNS::Resolver.Any pointers to alleviate my dumbness would be appreciated. Thanks