Skip to content

Commit 079dff6

Browse files
committed
perldelta for Time::HiRes 1.9779 (sleep prototype)
1 parent c6738c4 commit 079dff6

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

pod/perldelta.pod

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,21 @@ XXX Remove this section if F<Porting/corelist-perldelta.pl> did not add any cont
125125

126126
=item *
127127

128-
L<XXX> has been upgraded from version A.xx to B.yy.
128+
L<Time::HiRes> has been upgraded from version 1.9778 to 1.9779.
129129

130-
XXX If there was something important to note about this change, include that here.
130+
The subsecond-resolution C<sleep> function provided by L<Time::HiRes> now has
131+
the same prototype as perl's built-in L<sleep function|perlfunc/sleep>. This
132+
means it now requires a scalar argument, not a list, just like C<CORE::sleep>:
133+
134+
use Time::HiRes qw(sleep);
135+
136+
sleep(1, "foo", "bar"); # Syntax error.
137+
# It used to silently ignore the extra arguments.
138+
139+
my @t = 42;
140+
sleep @t;
141+
# Evaluates @t in scalar context (giving the number of elements)
142+
# and sleeps for one second. It used to sleep for 42 seconds.
131143

132144
=back
133145

0 commit comments

Comments
 (0)