ORIGINAL POST:use IO::Socket::INET; use IO::Socket::INET6; BEGIN { $::{'IO::'}{'Socket::'}{'INET::'} = $::{'IO::'}{'Socket::'}{'I +NET6::'} }
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Forcing IPv6 onto existing modules
by moritz (Cardinal) on Dec 17, 2008 at 15:06 UTC | |
|
Re: Forcing IPv6 onto existing modules
by kyle (Abbot) on Dec 17, 2008 at 16:24 UTC | |
by GrandFather (Saint) on Dec 17, 2008 at 19:47 UTC | |
|
Re: Forcing IPv6 onto existing modules
by DStaal (Chaplain) on Dec 17, 2008 at 16:36 UTC | |
by mr_mischief (Monsignor) on Dec 17, 2008 at 16:49 UTC | |
by cdybedahl (Acolyte) on Dec 18, 2008 at 08:10 UTC | |
|
Re: Forcing IPv6 onto existing modules
by ikegami (Patriarch) on Dec 17, 2008 at 20:09 UTC | |
by cdybedahl (Acolyte) on Dec 18, 2008 at 08:12 UTC | |
by Anonymous Monk on Dec 26, 2008 at 22:28 UTC | |
|
Re: Forcing IPv6 onto existing modules
by Tanktalus (Canon) on Dec 17, 2008 at 23:14 UTC |