Simplify code that sets $VERSION on the "package" line
Rafael Garcia-Suarez [Thu, 8 Oct 2009 12:56:56 +0000 (14:56 +0200)]
op.c

diff --git a/op.c b/op.c
index 740e464..1ccd512 100644 (file)
--- a/op.c
+++ b/op.c
@@ -3821,10 +3821,7 @@ Perl_package_version( pTHX_ OP *v )
 {
     dVAR;
     PERL_ARGS_ASSERT_PACKAGE_VERSION;
-    SV *const version = cSVOPx(v)->op_sv;
-    SV *const pkgname = sv_mortalcopy(PL_curstname);
-    sv_catpv(pkgname, "::VERSION");
-    sv_setsv( get_sv(SvPV_nolen(pkgname),TRUE), version );
+    sv_setsv( GvSV(gv_fetchpvs("VERSION", GV_ADDMULTI, SVt_PV)), cSVOPx(v)->op_sv );
     op_free(v);
 }