in reply to perl and getaddrinfo API

my @ip = map { hex($_) } map { /(..)/g } unpack("H*",$pip); print join '.',@ip;
Since the system call gethostbyname results in a C struct, it can be unpacked.