perl windows IPv6



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 and will access IPv6-only sites such as

It has ActivePerl 5.14.2 (I also tried Strawberry Perl

Here’s a simple test script:

use Socket qw( getaddrinfo );
$host = '';
$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 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?





The following “works for me” on OSX, which can successfully ping -6

$ perl -lE'use Socket qw( getaddrinfo );
   ($err, @addrs) = getaddrinfo(q{}, 0);
   die $err if $err; print map { "@{[ %$_ ]}" } @addrs;'
protocol 17 canonname  addr ?? socktype 2 family 30protocol 6 canonname  addr ?? socktype 1 family 30

I think your problem isn’t the Perl bit, as the same code Works For Me.


[], [], []

Facebook Comments

Post a comment