Recently I've been writing a module that provides an interface to Socket6's getaddrinfo() and getnameinfo() functions. While writing this, it occured to me that not all systems are capable of using it yet, so I started to hack up some emulation of the functions, that allows users to use the same interface that would work on Socket6, but is internally emulated using such functions as gethostbyname().
I've decided to pull that work out into its own module, which could be used independently. Before I CPAN it, I'd appreciate any comments people might have. It doesn't yet have docs, but that should be easy to add. Find attached a dist tarball. Usage is straight-forward; just use it instead of "Socket6"; e.g. use Socket::GetAddrInfo qw( getnameinfo ); ... my ( $name, $service ) = getnameinfo( $socket->peername ); If Socket6 was previously loaded, it will be used. If not, it will be emulated using the legacy functions. Are there any downsides to this approach? I've not yet come up with a good way to test it nicely. Ideally the testing machine needs to have Socket6 installed. I don't want to just test by comparing emulated vs. real output though, because these might legitimately differ (e.g. if the system defines that "localhost" also be IPv6 address "::1"). -- Paul "LeoNerd" Evans [EMAIL PROTECTED] ICQ# 4135350 | Registered Linux# 179460 http://www.leonerd.org.uk/
Socket-GetAddrInfo-0.01.tar.gz
Description: Binary data
signature.asc
Description: Digital signature
