source:
trunk/essentials/dev-lang/perl/lib/strict.pm@
3298
| Last change on this file since 3298 was 3181, checked in by , 19 years ago | |
|---|---|
| File size: 3.2 KB | |
| Line | |
|---|---|
| 1 | package strict; |
| 2 | |
| 3 | $strict::VERSION = "1.03"; |
| 4 | |
| 5 | my %bitmask = ( |
| 6 | refs => 0x00000002, |
| 7 | subs => 0x00000200, |
| 8 | vars => 0x00000400 |
| 9 | ); |
| 10 | |
| 11 | sub bits { |
| 12 | my $bits = 0; |
| 13 | my @wrong; |
| 14 | foreach my $s (@_) { |
| 15 | push @wrong, $s unless exists $bitmask{$s}; |
| 16 | $bits |= $bitmask{$s} || 0; |
| 17 | } |
| 18 | if (@wrong) { |
| 19 | require Carp; |
| 20 | Carp::croak("Unknown 'strict' tag(s) '@wrong'"); |
| 21 | } |
| 22 | $bits; |
| 23 | } |
| 24 | |
| 25 | my $default_bits = bits(qw(refs subs vars)); |
| 26 | |
