diff --git a/meson.build b/meson.build
index 18b5be842e3..80b412f741b 100644
--- a/meson.build
+++ b/meson.build
@@ -3419,7 +3419,7 @@ alias_target('pgdist', [tar_gz, tar_bz2])
 # But not if we are in a subproject, in case the parent project wants to
 # create a dist using the standard Meson command.
 if not meson.is_subproject()
-  meson.add_dist_script(perl, '-e', 'exit 1')
+  meson.add_dist_script(perl.path(), '-e', 'exit 1')
 endif
 
 
