Philip, > Try the following patch. If it works for you, I'll rerelease as 1.19: > my ($self, $ip, $bits, $data) = @_; > - $data ||= $bits ? "$ip/$bits" : $ip; > + $data ||= defined $bits ? "$ip/$bits" : $ip; > my $packed = inet_pton(AF_INET6, $ip) || croak("invalid key");
Hmm. What I had in mind was a: $data = $bits ? "$ip/$bits" : $ip if !defined $data; > > $ perl -e 'use Socket6; use Net::Patricia' > > Prototype mismatch: sub main::AF_INET6: none vs () > > at /usr/local/lib/perl5/5.12.2/Exporter.pm line 64. > > That's someone else's bug: > https://rt.cpan.org/Public/Bug/Display.html?id=32362 > > and represents a defect in Socket6. The work-around is to include > Socket before Socket6. Thanks for the reference. I can live with that. The Net::Patricia use (optional) is now in the SpamAssassin svn trunk (on its way to become 3.4), see: https://issues.apache.org/SpamAssassin/show_bug.cgi?id=6508 Thanks for pointing out its existence and for writing/maintaining it. Btw, one more suggestion: it would be nice to be able to AVOID loading the Net::CIDR::Lite module into memory (even when it is available) if one does not need add_cidr() and remove_cidr() routines. For services running in many instances (like child processes in spamd) saving any memory is beneficial. Mark