What's happened is that
IO::Socket::INET, which supports AF_INET and IPv4, has been
superceded by
IO::Socket::IP, which supports AF_INET6 and IPv6. It was designed to be a drop-in replacement for IO::Socket::INET in order to make it easier to use either IPv4, IPv6 or both of them. You do not have to use IPv6, and perl5.14x hasn't been setup that way. Here, straight from the documentation, is how you can do it:
#!/usr/bin/perl
use strict;
use warnings;
use IO::Socket::IP;
my $sock = IO::Socket::IP->new(
PeerHost =>"www.google.com",
PeerPort => "http",
Type => SOCK_STREAM,
) or die "Cannot construct socket: $@\n";
my $familyname = ( $sock->sockdomain == AF_INET ) ? "IPv4" :
"unknown";
+
+
printf "Connected to google via %s\n", $familyname;
You'll find more information here
here.
| [reply] [d/l] |
The Perl 5.14.1 README for Tru64 does not mention IPv6, but Perl should still build on systems without IPv6 support.
Without seeing what errors you get, it's hard to diagnose what goes wrong. Please do post the command line and output of ./configure, or, if the error is restricted to Socket, the errors you get when building Socket.pm. That way, maybe somebody can spot what goes wrong there.
| [reply] [d/l] |
Thanks for the reply. ./Configure goes fine (I am building with thread support enabled). When I do make, compilation of ext/Socket/Socket.c fails with this error:
make[1]: Entering directory `/usr/local/tmp/perl-5.14.0/ext/Socket'
cc -c -pthread -std1 -D_INTRINSICS -fprm d -ieee -trapuv -readonly_s
+trings -I/usr/local/include -DLANGUAGE_C -O4 -DVERSION=\"1.94\" -DX
+S_VERSION=\"1.94\" "-I../.." Socket.c
cc: Error: Socket.xs, line 666: In this declaration, "sin6" has no lin
+kage and is of an incomplete type. (incompnolink)
struct sockaddr_in6 sin6;
----------------------------^
cc: Error: Socket.xs, line 703: In this declaration, "sin6" has no lin
+kage and is of an incomplete type. (incompnolink)
struct sockaddr_in6 sin6;
----------------------------^
make[1]: *** [Socket.o] Error 1
make[1]: Leaving directory `/usr/local/tmp/perl-5.14.0/ext/Socket'
Unsuccessful make(ext/Socket): code=512 at make_ext.pl line 463.
make: *** [lib/auto/Socket/Socket.so] Error 2
| [reply] [d/l] |
I see you are trying to compile Perl 5.14.0 - is there any particular reason why you are not compiling 5.14.1, which might already fix your issue? Other than that, I would still look at the output of ./Configure and check whether (or why) it detects that you have IPv6 socket support. If it correctly claims that you don't have it, this would be a "simple" error in Socket.xs. If it incorrectly claims that you have IPv6 support, it's a matter of fixing Configure, or of moving the code that "works" for Configure to also work in real life.
| [reply] [d/l] |