> returns the integer number of seconds actually slept.
Excellent point, because any replacement has to mimic this behavior.
Afaik all implementations shown so far are broken in this respect.
(Yours too btw :)
| [reply] |
Excellent point, because any replacement has to mimic this behavior.
That depends on scope. If I write my watchdog.pl program which runs on my system, I might want a sleep override which returns the number of green bubbles appearing in my room at night whilst being asleep (ghosts, bengal fires), or a tupel having [ $seconds_slept, @things_missed ] monitoring the chatterbox, or anything else.
Things are different if I want to convince all perl programmers to use my sleep subroutine as a drop-in replacement for the builtin.
Update: in the context of this thread, you are right of course (make all imported modules use the overriden sleep()), so this comment is rather pointless. Well, at least it carries an idea for yet another silly program.
perl -le'print map{pack c,($-++?1:13)+ord}split//,ESEL'
| [reply] [d/l] [select] |