in reply to Re: Overloaded *CORE:: function not behaving correctly
in thread Overloaded *CORE:: function not behaving correctly

OK, both ysth and broquaint seem to be in agreement - you cant do it on the fly (ie like I did with a block-scope and a local operator) a CORE:: function. Looks like a separate test file that uses the BEGIN style is required

Does anyone know why this is so (the design decision, not the fact), and where the pre-compile requirement is documented ?

update s/can/cant/

use brain;

  • Comment on Re^2: Overloaded *CORE:: function not behaving correctly

Replies are listed 'Best First'.
Re^3: Overloaded *CORE:: function not behaving correctly
by broquaint (Abbot) on Jul 29, 2004 at 08:06 UTC
    I believe this is so that builtins aren't looked up every time they are called, which is almost certainly for speed reasons. Where the fact that this 'builtin overriding behaviour needs to be implemented at compile-time' is documented, I'm not sure. It might be documented in the 3rd Camel, but I can't seem to find hide or hair of it in the standard docs. A patch to the Overriding Built-in Functions section of perlsub is probably needed.
    HTH

    _________
    broquaint

      Second paragraph starts:
      Overriding may be done only by importing the name from a module at compile time--ordinary predeclaration isn't good enough.