in reply to Copy a builtin sub to a different name and then override

After reading perlsub#Overriding-Built-in-Functions

> To unambiguously refer to the built-in form, precede the built-in name with the special package qualifier CORE:: .  For example, saying CORE::open() always refers to the built-in open()

You should probably simply call CORE::sleep()

Have you tested if CORE::GLOBAL::sleep() even exists before overriding? *

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery

update

*) nope it doesn't

update

see also an explanation how to fix it with exists

  • Comment on Re: Copy a builtin sub to a different name and then override

Replies are listed 'Best First'.
Re^2: Copy a builtin sub to a different name and then override
by bliako (Abbot) on Jun 01, 2018 at 23:25 UTC
     You should probably simply call CORE::sleep()
    

    yep, that worked! The builtin sleep() cam be accessed via CORE::sleep(). I have posted the code under another comment. Many Thanks!

A reply falls below the community's threshold of quality. You may see it by logging in.