Change 34080 by [EMAIL PROTECTED] on 2008/06/23 16:55:46
Subject: Re: [perl #24174] perl-5.8.0-55 exit bug
From: Michael G Schwern <[EMAIL PROTECTED]>
Date: Mon, 13 Oct 2003 05:13:48 -0700
Message-ID: <[EMAIL PROTECTED]>
Affected files ...
... //depot/perl/pod/perlfunc.pod#602 edit
Differences ...
==== //depot/perl/pod/perlfunc.pod#602 (text) ====
Index: perl/pod/perlfunc.pod
--- perl/pod/perlfunc.pod#601~33848~ 2008-05-17 23:28:49.000000000 -0700
+++ perl/pod/perlfunc.pod 2008-06-23 09:55:46.000000000 -0700
@@ -5146,10 +5146,18 @@
=item sleep
Causes the script to sleep for EXPR seconds, or forever if no EXPR.
+Returns the number of seconds actually slept.
+
May be interrupted if the process receives a signal such as C<SIGALRM>.
-Returns the number of seconds actually slept. You probably cannot
-mix C<alarm> and C<sleep> calls, because C<sleep> is often implemented
-using C<alarm>.
+
+ eval {
+ local $SIG{ALARM} = sub { die "Alarm!\n" };
+ sleep;
+ };
+ die $@ unless $@ eq "Alarm!\n";
+
+You probably cannot mix C<alarm> and C<sleep> calls, because C<sleep>
+is often implemented using C<alarm>.
On some older systems, it may sleep up to a full second less than what
you requested, depending on how it counts seconds. Most modern systems
End of Patch.