This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
bench.pl: add 'compile' benchmark field
[perl5.git] / vutil.c
diff --git a/vutil.c b/vutil.c
index 610c03c..c033820 100644 (file)
--- a/vutil.c
+++ b/vutil.c
@@ -491,10 +491,10 @@ Perl_new_version(pTHX_ SV *ver)
            ver = SvRV(ver);
 
        /* Begin copying all of the elements */
-       if ( hv_exists(MUTABLE_HV(ver), "qv", 2) )
+       if ( hv_existss(MUTABLE_HV(ver), "qv") )
            (void)hv_stores(MUTABLE_HV(hv), "qv", newSViv(1));
 
-       if ( hv_exists(MUTABLE_HV(ver), "alpha", 5) )
+       if ( hv_existss(MUTABLE_HV(ver), "alpha") )
            (void)hv_stores(MUTABLE_HV(hv), "alpha", newSViv(1));
        {
            SV ** svp = hv_fetchs(MUTABLE_HV(ver), "width", FALSE);
@@ -840,7 +840,7 @@ Perl_vnumify(pTHX_ SV *vs)
        Perl_croak(aTHX_ "Invalid version object");
 
     /* see if various flags exist */
-    if ( hv_exists(MUTABLE_HV(vs), "alpha", 5 ) )
+    if ( hv_existss(MUTABLE_HV(vs), "alpha") )
        alpha = TRUE;
 
     if (alpha) {
@@ -968,13 +968,17 @@ Perl_vstringify(pTHX_ SV *vs)
     if (svp) {
        SV *pv;
        pv = *svp;
-       if ( SvPOK(pv) )
+       if ( SvPOK(pv)
+#if PERL_VERSION_LT(5,17,2)
+           || SvPOKp(pv)
+#endif
+       )
            return newSVsv(pv);
        else
            return &PL_sv_undef;
     }
     else {
-       if ( hv_exists(MUTABLE_HV(vs), "qv", 2) )
+       if ( hv_existss(MUTABLE_HV(vs), "qv") )
            return VNORMAL(vs);
        else
            return VNUMIFY(vs);