xref: /onnv-gate/usr/src/cmd/perl/5.8.4/distrib/ext/Opcode/ops.pm (revision 0:68f95e015346)
1*0Sstevel@tonic-gatepackage ops;
2*0Sstevel@tonic-gate
3*0Sstevel@tonic-gateour $VERSION = '1.00';
4*0Sstevel@tonic-gate
5*0Sstevel@tonic-gateuse Opcode qw(opmask_add opset invert_opset);
6*0Sstevel@tonic-gate
7*0Sstevel@tonic-gatesub import {
8*0Sstevel@tonic-gate    shift;
9*0Sstevel@tonic-gate    # Not that unimport is the prefered form since import's don't
10*0Sstevel@tonic-gate	# accumulate well owing to the 'only ever add opmask' rule.
11*0Sstevel@tonic-gate	# E.g., perl -Mops=:set1 -Mops=:setb is unlikely to do as expected.
12*0Sstevel@tonic-gate    opmask_add(invert_opset opset(@_)) if @_;
13*0Sstevel@tonic-gate}
14*0Sstevel@tonic-gate
15*0Sstevel@tonic-gatesub unimport {
16*0Sstevel@tonic-gate    shift;
17*0Sstevel@tonic-gate    opmask_add(opset(@_)) if @_;
18*0Sstevel@tonic-gate}
19*0Sstevel@tonic-gate
20*0Sstevel@tonic-gate1;
21*0Sstevel@tonic-gate
22*0Sstevel@tonic-gate__END__
23*0Sstevel@tonic-gate
24*0Sstevel@tonic-gate=head1 NAME
25*0Sstevel@tonic-gate
26*0Sstevel@tonic-gateops - Perl pragma to restrict unsafe operations when compiling
27*0Sstevel@tonic-gate
28*0Sstevel@tonic-gate=head1 SYNOPSIS
29*0Sstevel@tonic-gate
30*0Sstevel@tonic-gate  perl -Mops=:default ...    # only allow reasonably safe operations
31*0Sstevel@tonic-gate
32*0Sstevel@tonic-gate  perl -M-ops=system ...     # disable the 'system' opcode
33*0Sstevel@tonic-gate
34*0Sstevel@tonic-gate=head1 DESCRIPTION
35*0Sstevel@tonic-gate
36*0Sstevel@tonic-gateSince the ops pragma currently has an irreversible global effect, it is
37*0Sstevel@tonic-gateonly of significant practical use with the C<-M> option on the command line.
38*0Sstevel@tonic-gate
39*0Sstevel@tonic-gateSee the L<Opcode> module for information about opcodes, optags, opmasks
40*0Sstevel@tonic-gateand important information about safety.
41*0Sstevel@tonic-gate
42*0Sstevel@tonic-gate=head1 SEE ALSO
43*0Sstevel@tonic-gate
44*0Sstevel@tonic-gateOpcode(3), Safe(3), perlrun(3)
45*0Sstevel@tonic-gate
46*0Sstevel@tonic-gate=cut
47*0Sstevel@tonic-gate
48