Net::I...s_INET6(3pm)

πŸ“¦
version 0.604 Β· 3 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble, ubuntu resolute, ubuntu stonking

✨ Net::INET6Glue::INET_is_INET6 ✨

okay so bestie, welcome to the User Contributed Perl Documentation section of the vibe πŸ’– this one's filed under Net::I...s_INET6(3pm) (yeah the filename got chopped, we don't talk about it πŸ™ˆ) and honestly? it's giving "tiny module, massive slay".


🌸 NAME 🌸

Net::INET6Glue::INET_is_INET6 β€” the little glue module that makes IO::Socket::INET behave like IO::Socket::INET6. no cap. that's the whole assignment πŸ‘‘


πŸŽ€ SYNOPSIS πŸŽ€

use Net::INET6Glue::INET_is_INET6;
use LWP::Simple;
print get( 'http://[::1]:80' );
print get( 'http://ipv6.google.com' );

look at that. two little get calls, one of them hitting [::1] on port 80, one hitting ipv6.google.com, and you didn't have to rewrite a single line of your own code. iconic behaviour fr fr πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea β˜• bestie: so many modules out there go and directly create IO::Socket::INET sockets, or they've got it sitting up in their superclass chain. and because IO::Socket::INET has no support for IPv6, those modules don't have it either 😭 like, it's not their fault, they inherited it. generational curse energy.

so what does this module do? it tries to make IO::Socket::INET behave like IO::Socket::IP (with fallback to IO::Socket::INET6) by copying the symbol table from IO::Socket::IP into IO::Socket::INET. yes, the whole symbol table. it's a glow-up transplant ✨

and don't worry β€” the original symbol table from IO::Socket::INET is still available in IO::Socket::INET4. nothing got thrown away, it just moved apartments 🏠

this strategy works for Net::SMTP, LWP and probably a lot of other modules too β€” specifically the ones that don't try to depend too much on the innards of IO::Socket::INET or on the text representation of IP addresses (because IPv6 addresses look different than IPv4 addresses, and that's just facts πŸ’€). iykyk.

not me casually making every legacy IPv4-only module speak fluent IPv6 🧚

this module is copyright (c) 2008..2014, Steffen Ullrich. All Rights Reserved. this module is free software. it may be used, redistributed and/or modified under the same terms as Perl itself. so yes, you can absolutely use it, redistribute it, and remix it β€” same terms as Perl itself, periodt 🫢


and that's the whole page bestie, no crumbs left 🌈 just so you know the vibe check on the footer: this came from perl v5.32.1, dated 2021-02-28, page Net::I...s_INET6(3pm). stay glued, stay IPv6, mwah πŸ’‹πŸŽ€

πŸ“¦ where this page comes from