summaryrefslogtreecommitdiff
path: root/gv.c
diff options
context:
space:
mode:
authorJohn Peacock <jpeacock@rowman.com>2004-08-03 18:23:57 -0400
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2004-08-04 06:19:27 +0000
commitd7aa53827cc12fdf8a697328df844e16aaa58287 (patch)
tree3cdfee90125a42052b481afa420cd15c46d7b005 /gv.c
parent1be326de458e100f1527bf44371fc6d90f6f67fe (diff)
downloadperl-d7aa53827cc12fdf8a697328df844e16aaa58287.tar.gz
Final version object core patch?
Message-ID: <411048BD.3080700@rowman.com> p4raw-id: //depot/perl@23190
Diffstat (limited to 'gv.c')
-rw-r--r--gv.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/gv.c b/gv.c
index 2c6641d6f6..d9d16ed0a4 100644
--- a/gv.c
+++ b/gv.c
@@ -1061,25 +1061,19 @@ Perl_gv_fetchpv(pTHX_ const char *nambeg, I32 add, I32 sv_type)
case ']':
if (len == 1) {
SV *sv = GvSV(gv);
- (void)SvUPGRADE(sv, SVt_PVNV);
- Perl_sv_setpvf(aTHX_ sv,
-#if defined(PERL_SUBVERSION) && (PERL_SUBVERSION > 0)
- "%8.6"
-#else
- "%5.3"
-#endif
- NVff,
- SvNVX(PL_patchlevel));
- SvNVX(sv) = SvNVX(PL_patchlevel);
- SvNOK_on(sv);
+ if (!sv_derived_from(PL_patchlevel, "version"))
+ (void *)upg_version(PL_patchlevel);
+ sv = vnumify(PL_patchlevel);
SvREADONLY_on(sv);
+ GvSV(gv) = sv;
}
break;
case '\026': /* $^V */
if (len == 1) {
SV *sv = GvSV(gv);
- GvSV(gv) = SvREFCNT_inc(PL_patchlevel);
- SvREFCNT_dec(sv);
+ sv = new_version(PL_patchlevel);
+ SvREADONLY_on(sv);
+ GvSV(gv) = sv;
}
break;
}