From: Jarkko Hietaniemi Date: Mon, 4 Jun 2001 12:55:39 +0000 (+0000) Subject: Eradicate traces of 'asciirange' re subpragma. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=2570cdf10e029e79aea6f367c31eb4d83b4b6f66;p=p5sagit%2Fp5-mst-13.2.git Eradicate traces of 'asciirange' re subpragma. p4raw-id: //depot/perl@10427 --- diff --git a/ext/B/B/Deparse.pm b/ext/B/B/Deparse.pm index 7b8bf13..1560420 100644 --- a/ext/B/B/Deparse.pm +++ b/ext/B/B/Deparse.pm @@ -594,13 +594,13 @@ sub ambient_pragmas { elsif ($name eq 're') { require re; if ($val eq 'none') { - $hint_bits &= ~re::bits(qw/taint eval asciirange/); + $hint_bits &= ~re::bits(qw/taint eval/); next(); } my @names; if ($val eq 'all') { - @names = qw/taint eval asciirange/; + @names = qw/taint eval/; } elsif (ref $val) { @names = @$val; diff --git a/ext/MIME/Base64/QuotedPrint.pm b/ext/MIME/Base64/QuotedPrint.pm index 21110a0..8cf42b4 100644 --- a/ext/MIME/Base64/QuotedPrint.pm +++ b/ext/MIME/Base64/QuotedPrint.pm @@ -74,8 +74,6 @@ require Exporter; $VERSION = sprintf("%d.%02d", q$Revision: 2.3 $ =~ /(\d+)\.(\d+)/); -use re 'asciirange'; # ranges in regular expressions refer to ASCII - sub encode_qp ($) { my $res = shift; diff --git a/ext/re/re.pm b/ext/re/re.pm index f1a4e3b..32cee21 100644 --- a/ext/re/re.pm +++ b/ext/re/re.pm @@ -98,7 +98,7 @@ sub setcolor { sub bits { my $on = shift; my $bits = 0; - unless(@_) { + unless (@_) { require Carp; Carp::carp("Useless use of \"re\" pragma"); } @@ -111,19 +111,24 @@ sub bits { 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('$_')} sort keys %bitmask)]})"); + } } $bits; } sub import { shift; - $^H |= bits(1,@_); + $^H |= bits(1, @_); } sub unimport { shift; - $^H &= ~ bits(0,@_); + $^H &= ~ bits(0, @_); } 1; diff --git a/pod/perldiag.pod b/pod/perldiag.pod index 17b4b1b..2890989 100644 --- a/pod/perldiag.pod +++ b/pod/perldiag.pod @@ -3551,6 +3551,10 @@ representative, who probably put it there in the first place. (F) There are no byte-swapping functions for a machine with this byte order. +=item Unknown "re" subpragma '%s' (known ones are: %s) + +You tried to use an unknown subpragma of the "re" pragma. + =item Unknown switch condition (?(%.2s in regex; marked by <-- HERE in m/%s/ (F) The condition part of a (?(condition)if-clause|else-clause) construct