wip
[msysgit.git] / mingw / lib / ops.pm
blobaf3842918f4e16456d61baa3e8e917c7550c6ed3
1 package ops;
3 our $VERSION = '1.01';
5 use Opcode qw(opmask_add opset invert_opset);
7 sub import {
8 shift;
9 # Not that unimport is the preferred form since import's don't
10 # accumulate well owing to the 'only ever add opmask' rule.
11 # E.g., perl -Mops=:set1 -Mops=:setb is unlikely to do as expected.
12 opmask_add(invert_opset opset(@_)) if @_;
15 sub unimport {
16 shift;
17 opmask_add(opset(@_)) if @_;
22 __END__
24 =head1 NAME
26 ops - Perl pragma to restrict unsafe operations when compiling
28 =head1 SYNOPSIS
30 perl -Mops=:default ... # only allow reasonably safe operations
32 perl -M-ops=system ... # disable the 'system' opcode
34 =head1 DESCRIPTION
36 Since the ops pragma currently has an irreversible global effect, it is
37 only of significant practical use with the C<-M> option on the command line.
39 See the L<Opcode> module for information about opcodes, optags, opmasks
40 and important information about safety.
42 =head1 SEE ALSO
44 Opcode(3), Safe(3), perlrun(3)
46 =cut