Overriding of glob is special-cased. Instead of changing things so that Perl code is compiled to call your replacement routine "directly", the built-in &CORE::glob is still called and it notices (at run-time) the override and calls your replacement routine (and passes an extra argument that provides the context so that your replacement can correctly handle repeated calls made in scalar context). So you can't use CORE::glob("foo") to bypass this override (and you can't change the prototype of glob like you can with other overridden built-ins when using a recent version of Perl).
|