From: James E. Keenan Date: Sat, 13 Mar 2010 17:41:29 +0000 (-0500) Subject: Implement use strict 'subs' and 'refs' X-Git-Tag: accepted/trunk/20130322.191538~3330^2~152 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d710f38965e7534e900a3c8572cde25936b5a92e;p=platform%2Fupstream%2Fperl.git Implement use strict 'subs' and 'refs' With two understandable exceptions for use strict 'refs'. --- diff --git a/dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS.pm b/dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS.pm index ec4969d..4433868 100644 --- a/dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS.pm +++ b/dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS.pm @@ -1,4 +1,6 @@ package ExtUtils::ParseXS; +use strict 'subs'; +use strict 'refs'; use 5.006; # We use /??{}/ in regexes use Cwd; @@ -460,7 +462,9 @@ EOF $_ = shift(@line); while (my $kwd = check_keyword("REQUIRE|PROTOTYPES|FALLBACK|VERSIONCHECK|INCLUDE(?:_COMMAND)?|SCOPE")) { + no strict 'refs'; &{"${kwd}_handler"}(); + use strict 'refs'; next PARAGRAPH unless @line; $_ = shift(@line); } @@ -971,8 +975,7 @@ EOF } } - if ($Overload) # make it findable with fetchmethod - { + if ($Overload) { # make it findable with fetchmethod print Q(<<"EOF"); #XS(XS_${Packid}_nil); /* prototype to pass -Wmissing-prototypes */ #XS(XS_${Packid}_nil) @@ -1132,8 +1135,10 @@ sub process_keyword($) { my($pattern) = @_; my $kwd; + no strict 'refs'; &{"${kwd}_handler"}() while $kwd = check_keyword($pattern); + use strict 'refs'; } sub CASE_handler {