in reply to Perl and IPv6 on Windows

I asked about this a while back - see IPv6 Name Resolution.

The solution for me was to use Socket::GetAddrInfo with the following:

use if $] < 5.014, "Socket" => qw(inet_ntoa unpack_sockaddr_in IPPROT +O_TCP AF_INET AF_UNSPEC); use if $] < 5.014, "Socket6"; use if $] < 5.014, "Socket::GetAddrInfo" => qw(getaddrinfo getnameinf +o); use if $] >= 5.014, "Socket" => qw(:addrinfo inet_ntoa inet_ntop unpac +k_sockaddr_in unpack_sockaddr_in6 IPPROTO_TCP AF_INET AF_UNSPEC);

If you want your program to run on both Windows and Linux, good luck. Socket does have IPv6 support on Linux. With Windows, it appears the headers and libraries supplied with Strawberry's C compiler don't have the IPv6 routines (get*info); however, they ARE available on Windows and I've compiled C programs that use them. I'm guessing Strawberry Perl gcc compiler (headers and libraries) need to be updated and the Socket module recompiled as Windows 7 will support it, but not in the current Strawberry distribution (I'm running 5.12.3, but have also tested with 5.14).

UPDATE: See UPDATE section in Re^2: ipv6 support on windows.

Replies are listed 'Best First'.
Re^2: Perl and IPv6 on Windows
by Anonymous Monk on Jul 05, 2012 at 17:14 UTC
Re^2: Perl and IPv6 on Windows
by MalcolmH (Novice) on Jul 05, 2012 at 20:28 UTC

    Thank you for the insights.

    Ultimately, I do need to cover Windows and *NIX so it makes a huge amount of sense to develop using the new getaddrinfo() in Perl Core.

    I'm not that interested in messing around with Socket6 or Socket::GetAddrInfo and trying to build them on Windoze.

    Unfortunately, the *NIX boxes I currently have access to are not yet IPv6 ready so I tried to start work using a Win 7 machine that is. But at this point, I'm inclined to try and build a Linux box with IPv6 and proceed using that as my development platform. Hopefully ActivePerl and/or Strawberry Perl on Windows will catch up in the fullness of time.

      You may want to take a look at AnyEvent::Socket. It's not quite the same, as it includes it's own DNS layer, bypassing system libraries.

      Well, I threw Ubuntu on an old laptop, added IPv6, and have Perl talking to a IPv6-only server. This will allow me to proceed with development using a sound platform.

      I do hope ActiveState can fix ActivePerl on Windows before too long.