From d710f38965e7534e900a3c8572cde25936b5a92e Mon Sep 17 00:00:00 2001 From: "James E. Keenan" Date: Sat, 13 Mar 2010 12:41:29 -0500 Subject: [PATCH] Implement use strict 'subs' and 'refs' With two understandable exceptions for use strict 'refs'. --- dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS.pm | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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 { -- 2.7.4