%Bits = (
'all' => "\x55\x55\x55\x55\x55\x55\x55\x55\x55", # [0..35]
'ambiguous' => "\x00\x00\x00\x00\x01\x00\x00\x00\x00", # [16]
+ 'bareword' => "\x00\x00\x00\x00\x04\x00\x00\x00\x00", # [17]
'closed' => "\x04\x00\x00\x00\x00\x00\x00\x00\x00", # [1]
'closure' => "\x00\x00\x00\x00\x00\x00\x40\x00\x00", # [27]
'debugging' => "\x00\x00\x00\x01\x00\x00\x00\x00\x00", # [12]
- 'deprecated' => "\x00\x00\x00\x00\x04\x00\x00\x00\x00", # [17]
- 'digit' => "\x00\x00\x00\x00\x10\x00\x00\x00\x00", # [18]
+ 'deprecated' => "\x00\x00\x00\x00\x10\x00\x00\x00\x00", # [18]
+ 'digit' => "\x00\x00\x00\x00\x40\x00\x00\x00\x00", # [19]
'exec' => "\x10\x00\x00\x00\x00\x00\x00\x00\x00", # [2]
'inplace' => "\x00\x00\x00\x04\x00\x00\x00\x00\x00", # [13]
'internal' => "\x00\x00\x00\x10\x00\x00\x00\x00\x00", # [14]
'misc' => "\x00\x10\x00\x00\x00\x00\x00\x00\x00", # [6]
'newline' => "\x40\x00\x00\x00\x00\x00\x00\x00\x00", # [3]
'numeric' => "\x00\x40\x00\x00\x00\x00\x00\x00\x00", # [7]
- 'octal' => "\x00\x00\x00\x00\x40\x00\x00\x00\x00", # [19]
+ 'octal' => "\x00\x00\x00\x00\x00\x01\x00\x00\x00", # [20]
'once' => "\x00\x00\x01\x00\x00\x00\x00\x00\x00", # [8]
'overflow' => "\x00\x00\x00\x00\x00\x00\x00\x01\x00", # [28]
- 'parenthesis' => "\x00\x00\x00\x00\x00\x01\x00\x00\x00", # [20]
+ 'parenthesis' => "\x00\x00\x00\x00\x00\x04\x00\x00\x00", # [21]
'pipe' => "\x00\x01\x00\x00\x00\x00\x00\x00\x00", # [4]
'portable' => "\x00\x00\x00\x00\x00\x00\x00\x04\x00", # [29]
- 'precedence' => "\x00\x00\x00\x00\x00\x04\x00\x00\x00", # [21]
'printf' => "\x00\x00\x00\x00\x00\x10\x00\x00\x00", # [22]
'recursion' => "\x00\x00\x04\x00\x00\x00\x00\x00\x00", # [9]
'redefine' => "\x00\x00\x10\x00\x00\x00\x00\x00\x00", # [10]
%DeadBits = (
'all' => "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa", # [0..35]
'ambiguous' => "\x00\x00\x00\x00\x02\x00\x00\x00\x00", # [16]
+ 'bareword' => "\x00\x00\x00\x00\x08\x00\x00\x00\x00", # [17]
'closed' => "\x08\x00\x00\x00\x00\x00\x00\x00\x00", # [1]
'closure' => "\x00\x00\x00\x00\x00\x00\x80\x00\x00", # [27]
'debugging' => "\x00\x00\x00\x02\x00\x00\x00\x00\x00", # [12]
- 'deprecated' => "\x00\x00\x00\x00\x08\x00\x00\x00\x00", # [17]
- 'digit' => "\x00\x00\x00\x00\x20\x00\x00\x00\x00", # [18]
+ 'deprecated' => "\x00\x00\x00\x00\x20\x00\x00\x00\x00", # [18]
+ 'digit' => "\x00\x00\x00\x00\x80\x00\x00\x00\x00", # [19]
'exec' => "\x20\x00\x00\x00\x00\x00\x00\x00\x00", # [2]
'inplace' => "\x00\x00\x00\x08\x00\x00\x00\x00\x00", # [13]
'internal' => "\x00\x00\x00\x20\x00\x00\x00\x00\x00", # [14]
'misc' => "\x00\x20\x00\x00\x00\x00\x00\x00\x00", # [6]
'newline' => "\x80\x00\x00\x00\x00\x00\x00\x00\x00", # [3]
'numeric' => "\x00\x80\x00\x00\x00\x00\x00\x00\x00", # [7]
- 'octal' => "\x00\x00\x00\x00\x80\x00\x00\x00\x00", # [19]
+ 'octal' => "\x00\x00\x00\x00\x00\x02\x00\x00\x00", # [20]
'once' => "\x00\x00\x02\x00\x00\x00\x00\x00\x00", # [8]
'overflow' => "\x00\x00\x00\x00\x00\x00\x00\x02\x00", # [28]
- 'parenthesis' => "\x00\x00\x00\x00\x00\x02\x00\x00\x00", # [20]
+ 'parenthesis' => "\x00\x00\x00\x00\x00\x08\x00\x00\x00", # [21]
'pipe' => "\x00\x02\x00\x00\x00\x00\x00\x00\x00", # [4]
'portable' => "\x00\x00\x00\x00\x00\x00\x00\x08\x00", # [29]
- 'precedence' => "\x00\x00\x00\x00\x00\x08\x00\x00\x00", # [21]
'printf' => "\x00\x00\x00\x00\x00\x20\x00\x00\x00", # [22]
'recursion' => "\x00\x00\x08\x00\x00\x00\x00\x00\x00", # [9]
'redefine' => "\x00\x00\x20\x00\x00\x00\x00\x00\x00", # [10]
my $catmask ;
my $fatal = 0 ;
foreach my $word (@_) {
- if ($word eq 'FATAL')
- { $fatal = 1 }
- elsif ($catmask = $Bits{$word}) {
- $mask |= $catmask ;
- $mask |= $DeadBits{$word} if $fatal ;
+ if ($word eq 'FATAL') {
+ $fatal = 1;
+ }
+ else {
+ if ($catmask = $Bits{$word}) {
+ $mask |= $catmask ;
+ $mask |= $DeadBits{$word} if $fatal ;
+ }
}
- else
- { croak "unknown warning category '$word'" }
}
return $mask ;
sub import {
shift;
- ${^Warnings} |= bits(@_ ? @_ : 'all') ;
+ ${^WARNING_BITS} |= bits(@_ ? @_ : 'all') ;
}
sub unimport {
shift;
- ${^Warnings} &= ~ bits(@_ ? @_ : 'all') ;
+ ${^WARNING_BITS} &= ~ bits(@_ ? @_ : 'all') ;
}
sub enabled
my $string = shift ;
return 1
- if $bits{$string} && ${^Warnings} & $bits{$string} ;
+ if $bits{$string} && ${^WARNING_BITS} & $bits{$string} ;
return 0 ;
}