in reply to reval in Safe.pm and objects

From the Safe perldoc
reval (STRING) This evaluates STRING as perl code inside the compartment. The code can only see the compartment's namespace (as returned by the root method). The compartment's root package appears to be the main:: package to the code inside the compartment.
so the code in the compartment can't see any other namespaces so it doesn't know that the Person namespace exists. Try
$string = <<'EOM'; use Person; $data = { 'person' => bless( [ 42 ], 'Person' ) }; EOM

--

flounder

Replies are listed 'Best First'.
Re^2: reval in Safe.pm and objects
by Aristotle (Chancellor) on Sep 07, 2002 at 05:05 UTC
    This will not properly work if the Person module uses operations not permitted inside the compartment, like (most probably) any IO.

    Makeshifts last the longest.