in reply to Override built-in functions?
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.
°) 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 | |
|
Re^2: Override built-in functions?
by TorontoJim (Beadle) on Dec 15, 2020 at 14:07 UTC |