Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
1014 B

  1. package ops;
  2. use Opcode qw(opmask_add opset invert_opset);
  3. sub import {
  4. shift;
  5. # Not that unimport is the prefered form since import's don't
  6. # accumulate well owing to the 'only ever add opmask' rule.
  7. # E.g., perl -Mops=:set1 -Mops=:setb is unlikely to do as expected.
  8. opmask_add(invert_opset opset(@_)) if @_;
  9. }
  10. sub unimport {
  11. shift;
  12. opmask_add(opset(@_)) if @_;
  13. }
  14. 1;
  15. __END__
  16. =head1 NAME
  17. ops - Perl pragma to restrict unsafe operations when compiling
  18. =head1 SYNOPSIS
  19. perl -Mops=:default ... # only allow reasonably safe operations
  20. perl -M-ops=system ... # disable the 'system' opcode
  21. =head1 DESCRIPTION
  22. Since the ops pragma currently has an irreversible global effect, it is
  23. only of significant practical use with the C<-M> option on the command line.
  24. See the L<Opcode> module for information about opcodes, optags, opmasks
  25. and important information about safety.
  26. =head1 SEE ALSO
  27. Opcode(3), Safe(3), perlrun(3)
  28. =cut