[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]
[PATCH 63] check parms to strict.pm (was Re: [ID 20000125.006])
See <URL:http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2000-01/msg01175.html>
This should also apply against 5.00503's strict.pm.
[6:49] ruby% diff -u strict.pm.63 strict.pm
--- strict.pm.63 Wed Jan 26 06:40:54 2000
+++ strict.pm Wed Jan 26 06:49:18 2000
@@ -19,8 +19,8 @@
If no import list is supplied, all possible restrictions are assumed.
(This is the safest mode to operate in, but is sometimes too strict for
-casual programming.) Currently, there are three possible things to be
-strict about: "subs", "vars", and "refs".
+casual programming.) Currently, there are three possible strictures:
+"subs", "vars", and "refs".
=over 6
@@ -90,7 +90,15 @@
sub bits {
my $bits = 0;
- foreach my $s (@_){ $bits |= $bitmask{$s} || 0; };
+ foreach my $s (@_) {
+ if ($bitmask{$s}) {
+ $bits |= $bitmask{$s};
+ }
+ else {
+ require Carp;
+ Carp::carp("Unknown stricture `$s'");
+ }
+ }
$bits;
}
End of Patch.
- Follow-Ups from:
-
Jarkko Hietaniemi <jhi@iki.fi>
[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]