Perl Security: 7. Restricted compartments: The Safe module Restricted namespace Don't trust a module's code but still have to run it? Lock it in a safe! Remember, of course, to checkperldoc Safe use Safe; my $compart = Safe->new(); This will allow you to: Define a namespace to which this symbol will be restricted, denying it access to any other namespaces in our program except by using the symbols $_, @_ and %_, as well as those declared when creating the safe (with $compart->share('&allowed_sub'); The default namespace for the first compartment is Safe::Root0. The second one will be Safe::Root1, and so on. We can specify a desired namespace when creating the compartment: my $compart = Safe->new('hidden');will use hidden as its namespace.