sub bits {
my $bits = 0;
- foreach my $s (@_){ $bits |= $bitmask{$s} || 0; };
+ my @wrong;
+ foreach my $s (@_) {
+ push @wrong, $s unless exists $bitmask{$s};
+ $bits |= $bitmask{$s} || 0;
+ }
+ if (@wrong) {
+ my $useno = {
+ __PACKAGE__.'::import' => 'use',
+ __PACKAGE__.'::unimport' => 'no'
+ }->{ (caller(1))[3] };
+ require Carp;
+ Carp::croak("Don't know how to '$useno ".__PACKAGE__." qw(@wrong)'");
+ }
$bits;
}
undef $/;
-print "1..", scalar @prgs, "\n";
+print "1..", @prgs + 4, "\n";
for (@prgs){
foreach (@temps)
{ unlink $_ if $_ }
}
+
+eval qq(use strict 'garbage');
+print +($@ =~ /^Don't know how to 'use strict qw\(garbage\)/)
+ ? "ok ".++$i."\n" : "not ok ".++$i."\t# $@";
+
+eval qq(no strict 'garbage');
+print +($@ =~ /^Don't know how to 'no strict qw\(garbage\)/)
+ ? "ok ".++$i."\n" : "not ok ".++$i."\t# $@";
+
+eval qq(use strict qw(foo bar));
+print +($@ =~ /^Don't know how to 'use strict qw\(foo bar\)/)
+ ? "ok ".++$i."\n" : "not ok ".++$i."\t# $@";
+
+eval qq(no strict qw(foo bar));
+print +($@ =~ /^Don't know how to 'no strict qw\(foo bar\)/)
+ ? "ok ".++$i."\n" : "not ok ".++$i."\t# $@";