summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorperl-5.8.0@ton.iguana.be <perl-5.8.0@ton.iguana.be>2003-10-28 13:37:49 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2003-10-29 06:51:19 +0000
commitbe2f7487fc96cdcf159c9733c5c0dcd982e12af0 (patch)
tree8c424e3e0f622272322fd24f2c90af3e77f0c338
parent690f7c5f9e0ee073c67e83215cf3b54948d9b440 (diff)
downloadperl-be2f7487fc96cdcf159c9733c5c0dcd982e12af0.tar.gz
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-id: //depot/perl@21575
-rw-r--r--pod/perlfunc.pod26
1 files changed, 13 insertions, 13 deletions
diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod
index 6b093eb790..7879e3493b 100644
--- a/pod/perlfunc.pod
+++ b/pod/perlfunc.pod
@@ -1654,6 +1654,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
@@ -2286,21 +2298,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