FAQ sync
[p5sagit/p5-mst-13.2.git] / ext / Storable / Storable.xs
index 2590bfa..d3c0fab 100644 (file)
@@ -18,6 +18,8 @@
 #endif
 
 #if !defined(PERL_VERSION) || PERL_VERSION < 8
+#define NEED_load_module
+#define NEED_vload_module
 #include "ppport.h"             /* handle old perls */
 #endif
 
@@ -6289,7 +6291,11 @@ static SV *dclone(pTHX_ SV *sv)
         * Tied elements seem to need special handling.
         */
 
-       if (SvTYPE(sv) == SVt_PVLV && SvRMAGICAL(sv) && mg_find(sv, 'p')) {
+       if ((SvTYPE(sv) == SVt_PVLV
+#if PERL_VERSION < 8
+            || SvTYPE(sv) == SVt_PVMG
+#endif
+            ) && SvRMAGICAL(sv) && mg_find(sv, 'p')) {
                mg_get(sv);
        }