| Next: The parser call Previous: Foreign tag integration Contents: Contents |
If the special opcode ALL was passed, all embedded Perl operations are permitted and there's no need to perform them in a compartment provided by the Safe module. This is flagged by a true scalar value. Otherwise, we need to construct a Safe object and to configure it according to the opcode settings.
# Set up active contents handling. By default, we use a Safe object.
my $safe=new Safe;
if (exists $options{safeOpcode})
{
unless (grep($_ eq 'ALL', @{$options{safeOpcode}}))
{
# configure compartment
$safe->permit(@{$options{safeOpcode}});
}
else
{
# simply flag that we want to execute active contents
$safe=1;
}
} |
The variable $safe which is prepared by this code is intended to be passed to the parser soon.
| Next: The parser call Previous: Foreign tag integration Contents: Contents |