From: Michael G. Schwern Date: Mon, 13 Oct 2003 05:13:48 +0000 (-0700) Subject: Re: [perl #24174] perl-5.8.0-55 exit bug X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b48653af3d8bbfd0f502d07871e8cbfb4c62dd6c;p=p5sagit%2Fp5-mst-13.2.git Re: [perl #24174] perl-5.8.0-55 exit bug Message-ID: <20031013121348.GB21103@windhund.schwern.org> p4raw-id: //depot/perl@34080 --- diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod index 864699d..840ddbc 100644 --- a/pod/perlfunc.pod +++ b/pod/perlfunc.pod @@ -5146,10 +5146,18 @@ X X =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. -Returns the number of seconds actually slept. You probably cannot -mix C and C calls, because C is often implemented -using C. + + eval { + local $SIG{ALARM} = sub { die "Alarm!\n" }; + sleep; + }; + die $@ unless $@ eq "Alarm!\n"; + +You probably cannot mix C and C calls, because C +is often implemented using C. 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