diff --git a/src/pl/plperl/plperl.c b/src/pl/plperl/plperl.c
index f7cda64b73..46209c8cd4 100644
--- a/src/pl/plperl/plperl.c
+++ b/src/pl/plperl/plperl.c
@@ -700,7 +700,7 @@ plperl_trusted_init(void)
 		if (!isGV_with_GP(sv) || !GvCV(sv))
 			continue;
 		SvREFCNT_dec(GvCV(sv)); /* free the CV */
-		GvCV(sv) = NULL;		/* prevent call via GV */
+		GvCV_set(sv, NULL);		/* prevent call via GV */
 	}
 	hv_clear(stash);
 	/* invalidate assorted caches */
diff --git a/src/pl/plperl/plperl.h b/src/pl/plperl/plperl.h
index f33cb869f2..4efc8f02ef 100644
--- a/src/pl/plperl/plperl.h
+++ b/src/pl/plperl/plperl.h
@@ -43,6 +43,11 @@
 #undef bool
 #endif
 
+/* supply GvCV_set if it's missing - ppport.h doesn't supply it, unfortunately */
+#ifndef GvCV_set
+#define GvCV_set(gv, cv)		(GvCV(gv) = cv)
+#endif
+
 /* routines from spi_internal.c */
 int			spi_DEBUG(void);
 int			spi_LOG(void);