I agree. You'd basically have to rewrite the perl interpreter so that can run a copy of itself as child process in a sandbox and only return a safe, sanitized hashref. To quote RFC1925:
(5) It is always possible to aglutenate multiple separate problems
into a single complex interdependent solution. In most cases
this is a bad idea.
With enough software engineering, this is certainly possible, at least to a certain extend, but
(3) With sufficient thrust, pigs fly just fine. However, this is
not necessarily a good idea. It is hard to be sure where they
are going to land, and it could be dangerous sitting under the
+m
as they fly overhead.