In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/2b79cfef7518ea0ccd16f1b34ef8dd2b25877f35?hp=8ce2ba821761a7ada1e1def512c0374977759cf7>
- Log ----------------------------------------------------------------- commit 2b79cfef7518ea0ccd16f1b34ef8dd2b25877f35 Author: Father Chrysostomos <[email protected]> Date: Fri Mar 27 13:30:29 2015 -0700 [perl #124153] Fix require(v5.6) For some reason the argument to require v5.6 has the NOK flag on, but the parenthesized version lacks that flag, so the code added in v5.21.3-504-ged6f447 to precompute the hash was wrong, and caused require(v5.6) to lose its vstringness. ----------------------------------------------------------------------- Summary of changes: op.c | 3 ++- t/comp/require.t | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/op.c b/op.c index 3000c44..9404a47 100644 --- a/op.c +++ b/op.c @@ -10775,7 +10775,8 @@ Perl_ck_require(pTHX_ OP *o) unshare_hek(hek); SvFLAGS(sv) |= was_readonly; } - else if (SvPOK(sv) && !SvNIOK(sv) && !SvGMAGICAL(sv)) { + else if (SvPOK(sv) && !SvNIOK(sv) && !SvGMAGICAL(sv) + && !SvVOK(sv)) { s = SvPV(sv, len); if (SvREFCNT(sv) > 1) { kid->op_sv = newSVpvn_share( diff --git a/t/comp/require.t b/t/comp/require.t index be43c63..b3e4995 100644 --- a/t/comp/require.t +++ b/t/comp/require.t @@ -34,7 +34,7 @@ if (grep -e, @files_to_delete) { my $Is_EBCDIC = (ord('A') == 193) ? 1 : 0; my $Is_UTF8 = (${^OPEN} || "") =~ /:utf8/; -my $total_tests = 56; +my $total_tests = 57; if ($Is_EBCDIC || $Is_UTF8) { $total_tests -= 3; } print "1..$total_tests\n"; @@ -70,6 +70,10 @@ eval { require v5.5.630; }; print "# $@\nnot " if $@; print "ok ",$i++," - require 5.5.630\n"; +eval { require(v5.5.630); }; +print "# $@\nnot " if $@; +print "ok ",$i++," - require(v5.5.630) with parens [perl #124153]\n"; + sub v5 { die } eval { require v5; }; print "# $@\nnot " if $@; -- Perl5 Master Repository
