summaryrefslogtreecommitdiff
path: root/lib/strict.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/strict.pm')
-rw-r--r--lib/strict.pm23
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/strict.pm b/lib/strict.pm
new file mode 100644
index 0000000000..adaf47c720
--- /dev/null
+++ b/lib/strict.pm
@@ -0,0 +1,23 @@
+package strict;
+
+sub bits {
+ my $bits = 0;
+ foreach $sememe (@_) {
+ $bits |= 0x00000002 if $sememe eq 'refs';
+ $bits |= 0x00000200 if $sememe eq 'subs';
+ $bits |= 0x00000400 if $sememe eq 'vars';
+ }
+ $bits;
+}
+
+sub import {
+ shift;
+ $^H |= bits(@_ ? @_ : qw(refs subs vars));
+}
+
+sub unimport {
+ shift;
+ $^H &= ~ bits(@_ ? @_ : qw(refs subs vars));
+}
+
+1;