summaryrefslogtreecommitdiff
path: root/lib/strict.pm
blob: adaf47c720269081d9e07ead17988a8d40249e7e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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;