diff options
-rw-r--r-- | pod/pod2man.PL | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/pod/pod2man.PL b/pod/pod2man.PL index 4edf4f8bb2..3c55d6e29c 100644 --- a/pod/pod2man.PL +++ b/pod/pod2man.PL @@ -318,7 +318,11 @@ $cutting = 1; # running an installed version of Perl to produce documentation from an # uninstalled newer version's pod files. if ($^O ne 'plan9' and $^O ne 'dos' and $^O ne 'os2' and $^O ne 'MSWin32') { - my $perl = (-x './perl') ? './perl' : ((-x '../perl') ? '../perl' : ''); + my $perl = (-x './perl' && -f './perl' ) ? + './perl' : + ((-x '../perl' && -f '../perl') ? + '../perl' : + ''); ($version,$patch) = `$perl -e 'print $]'` =~ /^(\d\.\d{3})(\d{2})?/ if $perl; } # No luck; we'll just go with the running Perl's version |