Front page | perl.perl6.users |
Postings from June 2018
From: Timo Paulssen
June 14, 2018 16:11
Message ID: email@example.com
If it's literally just the name of a sub that you'll immediately invoke,
you can side-step EVAL completely
::('&' ~ $RunSpecific)()
should do the trick.
::("&foo") will give you the sub object, and putting () after it will
immediately call it.
It will allow access to all subs, even from the core, so subs like "die"
and "exit" are reachable, but it's less dangerous than accepting any
random code. For one, it will only work with subs that don't take arguments.