This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Split OP_AELEMFAST_LEX out from OP_AELEMFAST.
[perl5.git] / ext / Opcode / ops.pm
CommitLineData
6badd1a5 1package ops;
2
ae8d64f5 3our $VERSION = '1.02';
28b605d8 4
6badd1a5 5use Opcode qw(opmask_add opset invert_opset);
6
7sub import {
8 shift;
3c4b39be 9 # Not that unimport is the preferred form since import's don't
6badd1a5 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.
2ea6c7ce 12 opmask_add(invert_opset opset(@_)) if @_;
6badd1a5 13}
14
15sub unimport {
16 shift;
2ea6c7ce 17 opmask_add(opset(@_)) if @_;
6badd1a5 18}
19
201;
21
22__END__
23
24=head1 NAME
25
26ops - Perl pragma to restrict unsafe operations when compiling
27
28=head1 SYNOPSIS
29
30 perl -Mops=:default ... # only allow reasonably safe operations
31
32 perl -M-ops=system ... # disable the 'system' opcode
33
34=head1 DESCRIPTION
35
86780939 36Since the C<ops> pragma currently has an irreversible global effect, it is
6badd1a5 37only of significant practical use with the C<-M> option on the command line.
38
39See the L<Opcode> module for information about opcodes, optags, opmasks
40and important information about safety.
41
42=head1 SEE ALSO
43
86780939 44L<Opcode>, L<Safe>, L<perlrun>
6badd1a5 45
46=cut
47