in reply to Override built-in functions?

> Is it because the procedure I'm writing is always called by the object handle? Does that make it NOT the same as the built-in function?

Exactly, because the method and the builtin are in different namespaces aka packages.

The method call -> will look into the "STASH" of MyPackage:: while calls to builtins are resolved in CORE:: (resp. CORE::GLOBAL ) °

You can actually override (some) builtin functions, but that's not what is happening here.

EDIT

°) see https://perldoc.perl.org/perlsub#Overriding-Built-in-Functions for details on real overriding

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

Replies are listed 'Best First'.
Re^2: Override built-in functions?
by choroba (Cardinal) on Dec 15, 2020 at 12:59 UTC
    See also CORE for some details on overriding.

    map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]
Re^2: Override built-in functions?
by TorontoJim (Beadle) on Dec 15, 2020 at 14:07 UTC
    Thank you both for the response and pointing me in interesting directions.