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?


In reply to Perl and IPv6 on Windows by MalcolmH

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.