[guest - Fri Jul 29 14:44:04 2005]:
Show quoted text> When I try a DNS query using version 0.53 of Net::DNS, I get the
> following error message:
> Can't coerce array into hash at
> /usr/local/lib/perl5/site_perl/5.8.0/sun4-
> solaris/Net/DNS/Resolver/Base.pm line 626.
>
> The same query works correctly with version 0.49.
Could you please try this patch:
--- lib/Net/DNS/Resolver/Base.pm (revision 477)
+++ lib/Net/DNS/Resolver/Base.pm (working copy)
@@ -574,8 +574,8 @@
my $sock;
my $sock_key = "$ns:$dstport";
my ($host,$port);
- if ($self->persistent_tcp && $self->{'sockets'}{$sock_key}) {
- $sock = $self->{'sockets'}{$sock_key};
+ if ($self->persistent_tcp && $self->{'sockets'}[AF_UNSPEC]{$sock_key}) {
+ $sock = $self->{'sockets'}[AF_UNSPEC]{$sock_key};
print ";; using persistent socket\n"
if $self->{'debug'};
} else {
@@ -623,7 +623,7 @@
next;
}
- $self->{'sockets'}{$sock_key} = $sock;
+ $self->{'sockets'}[AF_UNSPEC]{$sock_key} = $sock;
}
my $lenmsg = pack('n', length($packet_data));
@@ -1261,8 +1261,8 @@
my $sock;
my $sock_key = "$ns:$self->{'port'}";
- if ($self->{'persistent_tcp'} && $self->{'sockets'}->{$sock_key}) {
- $sock = $self->{'sockets'}->{$sock_key};
+ if ($self->{'persistent_tcp'} && $self->{'sockets'}[AF_UNSPEC]{$sock_key}) {
+ $sock = $self->{'sockets'}[AF_UNSPEC]{$sock_key};
print ";; using persistent socket\n" if $self->{'debug'};
} else {
@@ -1297,7 +1297,7 @@
next;
}
- $self->{'sockets'}{$sock_key} = $sock;
+ $self->{'sockets'}[AF_UNSPEC]{$sock_key} = $sock;
}