From: David Dyck Date: Tue, 15 Feb 2005 07:35:45 +0000 (+0000) Subject: Fix documentation bug in using Socket's import tags : X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4852725b6599d1cee72970100a6c19e0adc9b5b7;p=p5sagit%2Fp5-mst-13.2.git Fix documentation bug in using Socket's import tags : Subject: [perl #34141] example in perlbug -f getsockopt incomplete From: David Dyck (via RT) Message-ID: p4raw-id: //depot/perl@23971 --- diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod index 833e891..9458d1c 100644 --- a/pod/perlfunc.pod +++ b/pod/perlfunc.pod @@ -2115,13 +2115,13 @@ integer which you can decode using unpack with the C (or C) format. An example testing if Nagle's algorithm is turned on on a socket: - use Socket; + use Socket qw(:all); defined(my $tcp = getprotobyname("tcp")) or die "Could not determine the protocol number for tcp"; - # my $tcp = Socket::IPPROTO_TCP; # Alternative - my $packed = getsockopt($socket, $tcp, Socket::TCP_NODELAY) - or die "Could not query TCP_NODELAY SOCKEt option: $!"; + # my $tcp = IPPROTO_TCP; # Alternative + my $packed = getsockopt($socket, $tcp, TCP_NODELAY) + or die "Could not query TCP_NODELAY socket option: $!"; my $nodelay = unpack("I", $packed); print "Nagle's algorithm is turned ", $nodelay ? "off\n" : "on\n";