$compartment = new Safe; $compartment->permit_only(qw(:base_core :base_mem)); # very restrictive $result = $compartment->reval($unsafe_code);