From: Matt S Trout Date: Sun, 11 Nov 2012 19:48:29 +0000 (+0000) Subject: fix 5.16 crash due to qw() list being readonly X-Git-Tag: v1.004004~3 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=488f29661a7c0726872fc6086820a4413bcaf7a3;p=p5sagit%2Fstrictures.git fix 5.16 crash due to qw() list being readonly --- diff --git a/Changes b/Changes index f4307f7..4f53a99 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,4 @@ + - fix 5.16 crash due to qw() list being readonly 1.004003 - 2012-11-10 - check only once for presence of extra testing prereqs - explicitly specify no dynamic_config in META diff --git a/lib/strictures.pm b/lib/strictures.pm index 714faaa..21bd8b4 100644 --- a/lib/strictures.pm +++ b/lib/strictures.pm @@ -46,13 +46,16 @@ sub import { $extra_load_states ||= do { my (%rv, @failed); - for my $mod (qw(indirect multidimensional bareword::filehandles)) { + foreach my $mod (qw(indirect multidimensional bareword::filehandles)) { eval "require $mod; \$rv{'$mod'} = 1;" or do { push @failed, $mod; # courtesy of the 5.8 require bug - $mod =~ s|::|/|g; - delete $INC{"$mod.pm"}; + # (we do a copy because 5.16.2 at least uses the same read-only + # scalars for the qw() list and it doesn't seem worth a $^V check) + + (my $file = $mod) =~ s|::|/|g; + delete $INC{"${file}.pm"}; }; }