package re;
-$VERSION = 0.02;
+our $VERSION = 0.04;
=head1 NAME
# N.B. File::Basename contains a literal for 'taint' as a fallback. If
# taint is changed here, File::Basename must be updated as well.
my %bitmask = (
-taint => 0x00100000,
-eval => 0x00200000,
+taint => 0x00100000, # HINT_RE_TAINT
+eval => 0x00200000, # HINT_RE_EVAL
);
sub setcolor {
sub bits {
my $on = shift;
my $bits = 0;
- unless(@_) {
+ unless (@_) {
require Carp;
Carp::carp("Useless use of \"re\" pragma");
}
uninstall() unless $on;
next;
}
- $bits |= $bitmask{$s} || 0;
+ if (exists $bitmask{$s}) {
+ $bits |= $bitmask{$s};
+ } else {
+ require Carp;
+ Carp::carp("Unknown \"re\" subpragma '$s' (known ones are: @{[join(', ', map {qq('$_')} 'debug', 'debugcolor', sort keys %bitmask)]})");
+ }
}
$bits;
}
sub import {
shift;
- $^H |= bits(1,@_);
+ $^H |= bits(1, @_);
}
sub unimport {
shift;
- $^H &= ~ bits(0,@_);
+ $^H &= ~ bits(0, @_);
}
1;