to include '' around the op name. Document it in perldiag.
p4raw-id: //depot/perl@17973
opmask_add(opset(qw(fileno))); # add to global op_mask
print eval 'fileno STDOUT' ? "not ok $t\n" : "ok $t\n"; $t++; # fail
-print $@ =~ /fileno trapped/ ? "ok $t\n" : "not ok $t\n# $@\n"; $t++;
+print $@ =~ /'fileno' trapped/ ? "ok $t\n" : "not ok $t\n# $@\n"; $t++;
# --- check use of bit vector ops on opsets
Any attempt by the code in STRING to use an operator which is not permitted
by the compartment will cause an error (at run-time of the main program
but at compile-time for the code in STRING). The error is of the form
-"%s trapped by operation mask operation...".
+"'%s' trapped by operation mask...".
If an operation is trapped in this way, then the code in STRING will
not be executed. If such a trapped operation occurs or any other
$cpt = new Safe "Root";
$cpt->reval(q{ system("echo not ok 1"); });
-if ($@ =~ /^system trapped by operation mask/) {
+if ($@ =~ /^'system' trapped by operation mask/) {
print "ok 1\n";
} else {
print "#$@" if $@;
#define CHECKOP(type,o) \
((PL_op_mask && PL_op_mask[type]) \
? ( op_free((OP*)o), \
- Perl_croak(aTHX_ "%s trapped by operation mask", PL_op_desc[type]), \
+ Perl_croak(aTHX_ "'%s' trapped by operation mask", PL_op_desc[type]), \
Nullop ) \
: CALL_FPTR(PL_check[type])(aTHX_ (OP*)o))
name, and not a subroutine call. C<exists &sub()> will generate this
error.
+=item '%s' trapped by operation mask
+
+(F) You tried to use an operator from a Safe compartment in which it's
+disallowed. See L<Safe>.
+
=item Argument "%s" isn't numeric%s
(W numeric) The indicated string was fed as an argument to an operator