Subject: | Can't locate auto/Net/DNS/Resolver.al |
I'm trying to use Net::DNS::Resolver (v 0.52) with Net::XMPP, XML::Stream and perl 5.8.5 under Solaris 9. I installed Net::DNS from www.net-dns.org, and the install appeared to be clean. When I run my script, it causes the XML module to try to autoload the Net::DNS::Resolver code, which fails with the following message:
Can't locate auto/Net/DNS/Resolver.al in @INC (@INC contains: /usr/local/lib/perl5/5.8.5/sun4-solaris /usr/local/lib/perl5/5.8.5 /usr/local/lib/perl5/site_perl/5.8.5/sun4-solaris /usr/local/lib/perl5/site_perl/5.8.5 /usr/local/lib/perl5/site_perl/5.6.2 /usr/local/lib/perl5/site_perl/5.6.0 /usr/local/lib/perl5/site_perl .) at /usr/local/lib/perl5/site_perl/5.8.5/XML/Stream.pm line 683
I'm not great with OO module code, but I *think* the lines of interest from XML/Stream.pm are (the 'new' is line 683):
========
if (eval "require Net::DNS;" )
{
require Net::DNS;
import Net::DNS;
$NETDNS = 1;
}
else
{
$NETDNS = 0;
}
...
if ($NETDNS)
{
my $res = new Net::DNS::Resolver();
my $query = $res->query($self->{SIDS}->{newconnection}->{srv}.".".$self->{SIDS}->{newconnection}->{hostname},"SRV");
if ($query)
{
$self->{SIDS}->{newconnection}->{hostname} = ($query->answer)[0]->target();
$self->{SIDS}->{newconnection}->{port} = ($query->answer)[0]->port();
$self->debug(1,"Connect: srv host: $self->{SIDS}->{newconnection}->{hostname}");
$self->debug(1,"Connect: srv post: $self->{SIDS}->{newconnection}->{port}");
}
else
{
$self->debug(1,"Connect: srv query failed");
}
}
else
{
$self->debug(1,"Connect: srv query failed");
}
========
Note that I have the same problem with perl 5.8.5 under Linux (RHAS3). I could probably hack the Stream.pm module to just use Net::DNS regardless, but I'm not sure I could do it without causing any damage. :-)
Would you please let me know if I did anything wrong or missed something. From my reading of the AutoSplit documentation, it *looks* like the fix may be as simple as adding "sub *" lines after the __END__ in Net/DNS/Resolver.pm, but I'm not so sure I have that right.
Please let me know the right way to get this working. Thanks!