Welcome to the Monastery | |
PerlMonks |
Re^5: Copy a builtin sub to a different name and then override (API compatibility)by shmem (Chancellor) |
on Jun 03, 2018 at 14:43 UTC ( [id://1215780]=note: print w/replies, xml ) | Need Help?? |
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'
In Section
Seekers of Perl Wisdom
|
|