Perldoc fail: invalid argument -R

Posted by kscheidegger on 2017-02-02 11:37
Forums: Perl discussion | OS: Windows 10

I recently installed v5.24.1 form MSWin32-x64, replacing an earlier version. Perldoc now fails every time with a message "Invalid parameter - -R"

I have searched the Net for this error and found a few people asking the question but no answers. Evidently it is a Windows-only problem not occurring in Unix.

grahams
ActiveState Staff
Wed, 2017-02-15 12:09

This is confirmed in 5.24.1 and 5.22.3.

It's happening in the section where perldoc hands off to the local equivalent of nroff. On Win32 and Win64, a bug is allowing perldoc to get into a block of code intended to fix a problem on Debian Linux (bugs.debian.org/758689). This block won't run on Windows, so the handoff to pod2text fails.
C:\> perldoc CGI
Invalid parameter - -R

Workaround 1: Bypass perldoc and go directly to pod2text. Give pod2text the full path to the pod file.
pod2text C:\Perl\libCGI.pod

Workaround 2: Bypass the pager in perldoc.
perldoc -T CGI

Workaround 3: Use the previous release of 5.22.2 which has an older perldoc.

kscheidegger | Wed, 2017-02-15 14:14

Workaround 2, as amended, works. Many thanks.

Of course, a pager is needed, so I use:

perldoc -T CGI|more

But that's not difficult.