EDITED TO ADD: Unfortunately, it turns out that the README file for IO::Socket::INET6 says that it may in a future version lose the ability to talk IPv4. Which would totally kill what I'm doing here, which in turn makes me not want to put it on CPAN. Instead, I'll just point the relevant lines of code here. There's after all only about five of them...
use IO::Socket::INET; use IO::Socket::INET6; BEGIN { $::{'IO::'}{'Socket::'}{'INET::'} = $::{'IO::'}{'Socket::'}{'I +NET6::'} }
ORIGINAL POST:

I'm currently involved in one of the few projects in this world that uses real live IPv6. Not much and not exclusively, but some. Apart from a web frontend, the project is written in Perl. Which means that I need to use IPv6 from Perl. This is a less than positive experience.

The basics are there. There are modules that make writing new code that uses IPv6 as easy as it ever gets. The main one, IO::Socket::INET6, is a drop-in replacement for the core IO::Socket::INET. Easy as pie.

The problem is old modules. Since IPv6 support in Perl is implemented by separate modules from CPAN, old code doesn't automatically become v6 aware. If you're lucky, the author of the module has fixed it (Net::DNS is fine, for example). Most of the standard modules are not. libnet isn't. LWP isn't. If you want to fetch stuff from http://ipv6.google.com/ in Perl today, you're out of luck. Hack the module yourself, or call out to wget or curl.

However. Most of the these modules work just fine with IPv6 if you just replace IO::Socket::INET with IO::Socket::INET6. And we can do that after we load the modules, if we're willing to become overly intimate with perl's symbol tables.

Since I don't have time to wait for the modules to get fixed (if the lwp mailing list is anything to go by, that may take years even if I send in patches), I've written a short but evil module that messes with the symbol table for me. It works fine at least for Net::SMTP and LWP::Simple. I call it IPv6::Force at the moment, but that's not a good name.

So, a couple of questions for you lot.

  1. Is there any IPv6 activity going on in the Perl world that I have missed?
  2. What should I call my evil module?
  3. Should I upload it to CPAN?

In reply to Forcing IPv6 onto existing modules by cdybedahl

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.