diff options
author | Michael G. Schwern <schwern@pobox.com> | 2003-10-12 22:13:48 -0700 |
---|---|---|
committer | Steve Peters <steve@fisharerojo.org> | 2008-06-23 16:55:46 +0000 |
commit | b48653af3d8bbfd0f502d07871e8cbfb4c62dd6c (patch) | |
tree | 8c668f5c5e288e4a506becece8cb336682afc721 /pod | |
parent | 532939df3783fc17b262c6a30b57e0b086abe4aa (diff) | |
download | perl-b48653af3d8bbfd0f502d07871e8cbfb4c62dd6c.tar.gz |
Re: [perl #24174] perl-5.8.0-55 exit bug
Message-ID: <20031013121348.GB21103@windhund.schwern.org>
p4raw-id: //depot/perl@34080
Diffstat (limited to 'pod')
-rw-r--r-- | pod/perlfunc.pod | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod index 864699d98b..840ddbcc00 100644 --- a/pod/perlfunc.pod +++ b/pod/perlfunc.pod @@ -5146,10 +5146,18 @@ X<sleep> X<pause> =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 |