I know I could easily do something like
sub sin {
sin($_[0]);
}
and symbolically reference that for every function I need to symb ref, but I'd just like to know if there's a way to do something like
{$foo}(123);
vs.
&{$foo}(123);
which works, but not for core functions.
Thanks.
AFAIK no, you can't do it. For performance reasons,
CORE
functions never look at the symbol table UNLESS an equivalentCORE::GLOBAL
function has been declared at compile time. Unfortunately, you have to write thatCORE::GLOBAL
function and get it just right to simulate the calling conventions of the real function. SomeCORE
functions cannot be entirely reproduced without massive hacks,print
andopen
for example. SinceCORE::GLOBAL
is global an effects all your code and all library code you have to be sure to get it exactly right or cause very hard to debug errors. Some modules, such as autodie, have to go to great lengths to wrap around core functions.But here, let me show you where the gun locker and ammo are...
...of course, this is a massive security and maintainability hole. Don't do it.