I have a Perl/Windows app that uses TCP/IP sockets and I need to add IPv6 support.
I have a Windows 7 64-bit machine that is running IPv6 with a Hurricane Electric tunnel and it scores 10 out 10 on http://test-ipv6.com/ and will access IPv6-only sites such as http://loopsofzen.co.uk/.
It has ActivePerl 5.14.2 (I also tried Strawberry Perl 5.16.0.1).
Here's a simple test script:
use Socket qw( getaddrinfo );
$host = 'loopsofzen.co.uk';
$port = 80;
$hints = (socktype => SOCK_STREAM, family -> Socket::AF_INET6);
($err, @addrs) = getaddrinfo($host, 0);
die $err if $err;
and this produces the error:
no address associated with nodename at ip.pl line 6.
The (new) getaddrinfo()
function appears to be available and it does work if I set $host
to use an IPv4 hostname. But IPv6 doesn't appear to work at all.
What am I missing? Or is Perl/Windows/IPv6 still a lost cause for the time being?