This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Integrate:
authorperl-5.8.0@ton.iguana.be <perl-5.8.0@ton.iguana.be>
Tue, 28 Oct 2003 13:37:49 +0000 (13:37 +0000)
committerNicholas Clark <nick@ccl4.org>
Wed, 29 Oct 2003 18:42:35 +0000 (18:42 +0000)
[ 21575]
Move a fcntl() example in perlfunc at a more proper place,
as suggested by :
Subject: [perl #24334] ioctl/fcntl doc confusion
From: "perl-5.8.0@ton.iguana.be (via RT)" <perlbug-followup@perl.org>
Message-ID: <rt-24334-66603.12.4990768314782@rt.perl.org>
p4raw-link: @21575 on //depot/perl: be2f7487fc96cdcf159c9733c5c0dcd982e12af0

p4raw-id: //depot/maint-5.8/perl@21577
p4raw-integrated: from //depot/perl@21576 'merge in' pod/perlfunc.pod
(@21523..)

pod/perlfunc.pod

index 36b7f96..27e21ed 100644 (file)
@@ -1657,6 +1657,18 @@ Note that C<fcntl> will produce a fatal error if used on a machine that
 doesn't implement fcntl(2).  See the Fcntl module or your fcntl(2)
 manpage to learn what functions are available on your system.
 
+Here's an example of setting a filehandle named C<REMOTE> to be
+non-blocking at the system level.  You'll have to negotiate C<$|>
+on your own, though.
+
+    use Fcntl qw(F_GETFL F_SETFL O_NONBLOCK);
+
+    $flags = fcntl(REMOTE, F_GETFL, 0)
+                or die "Can't get flags for the socket: $!\n";
+
+    $flags = fcntl(REMOTE, F_SETFL, $flags | O_NONBLOCK)
+                or die "Can't set flags for the socket: $!\n";
+
 =item fileno FILEHANDLE
 
 Returns the file descriptor for a filehandle, or undefined if the
@@ -2289,21 +2301,9 @@ system:
     $retval = ioctl(...) || -1;
     printf "System returned %d\n", $retval;
 
-The special string "C<0> but true" is exempt from B<-w> complaints
+The special string C<"0 but true"> is exempt from B<-w> complaints
 about improper numeric conversions.
 
-Here's an example of setting a filehandle named C<REMOTE> to be
-non-blocking at the system level.  You'll have to negotiate C<$|>
-on your own, though.
-
-    use Fcntl qw(F_GETFL F_SETFL O_NONBLOCK);
-
-    $flags = fcntl(REMOTE, F_GETFL, 0)
-                or die "Can't get flags for the socket: $!\n";
-
-    $flags = fcntl(REMOTE, F_SETFL, $flags | O_NONBLOCK)
-                or die "Can't set flags for the socket: $!\n";
-
 =item join EXPR,LIST
 
 Joins the separate strings of LIST into a single string with fields