I forgot the dependencies on Windows. Despite what you read, the Socket module does not support IPv6 on Windows in Perl 5.14 (at least in the Strawberry distribution). You still need Socket6 or Socket::GetAddrInfo.

As you'll see in the modified code below, IO::Socket::IP is using Socket::GetAddrInfo in my case since I have it installed - do you?

use IO::Socket::IP -register; for my $m (sort(keys(%INC))) { print "$m\n" } my $sock = IO::Socket->new( Domain => PF_INET6, LocalHost => "::1", Listen => 1, ) or die "Cannot create socket - $@\n"; print "Created a socket of type " . ref($sock) . "\n";

And the output:

VinsWorldcom@C:\Users\VinsWorldcom\tmp> test.pl AutoLoader.pm C:/strawberry/perl/lib/auto/POSIX/autosplit.ix C:/strawberry/perl/lib/auto/POSIX/load_imports.al Carp.pm Config.pm Config_git.pl Config_heavy.pl DynaLoader.pm Errno.pm Exporter.pm Exporter/Heavy.pm Fcntl.pm IO.pm IO/Handle.pm IO/Socket.pm IO/Socket/INET.pm IO/Socket/IP.pm IO/Socket/UNIX.pm POSIX.pm SelectSaver.pm Socket.pm Socket/GetAddrInfo.pm Socket/GetAddrInfo/Core.pm Socket/GetAddrInfo/XS.pm Symbol.pm Tie/Hash.pm XSLoader.pm base.pm strict.pm vars.pm warnings.pm warnings/register.pm Created a socket of type IO::Socket::IP
UPDATE: Not quite right - the Socket module does support IPv6, the gcc compiler shipped with Strawberry 5.14 and recently verified 5.16 does not have the headers or the libraries to support compiling some of the IPv6 options - specifically inet_ntop() was failing for me. I recently corresponded with Paul Evans (https://rt.cpan.org/Ticket/Display.html?id=78890) - maintainer of Socket - and he clarified this for me. I have a workaround for compiling IPv6 support in Socket for Strawberry Perl on Windows that works for both 5.14 and 5.16 documented http://vinsworldcom.blogspot.com/2012/08/ipv6-in-perl-on-windows_20.html.

In reply to Re^2: ipv6 support on windows by VinsWorldcom
in thread ipv6 support on windows by sushant.ravale

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.