pritesh_ugrankar has asked for the wisdom of the Perl Monks concerning the following question:

Hi

The following error is noticed when I installed either strawberry perl or activestate perl and invoke perldocs:


Invalid parameter - -R

I tried re installing several times, still the same error. I did google but could not find anything affirmative or a workaround. Am I missing something or doing something wrong?


Update:

Hi,

As given on the strawberry perl site, The perldoc issue is resolved by running the command - cpanm http://strawberryperl.com/package/kmx/perl-modules-patched/Pod-Perldoc-3.27_patched.tar.gz

I tried the command from my work place and got errors, but came home and tried, it seems to work!! Given below is the output

C:\>cpanm http://strawberryperl.com/package/kmx/perl-modules-patched/P +od-Perldoc-3.27_patched.tar.gz --> Working on http://strawberryperl.com/package/kmx/perl-modules-patc +hed/Pod-Perldoc-3.27_patched.tar.gz Fetching http://strawberryperl.com/package/kmx/perl-modules-patched/Po +d-Perldoc-3.27_patched.tar.gz ... OK Configuring Pod-Perldoc-3.27 ... OK Building and testing Pod-Perldoc-3.27 ... OK Successfully installed Pod-Perldoc-3.27 1 distribution installed C:\>perldoc perldoc NAME perldoc - Look up Perl documentation in Pod format. SYNOPSIS perldoc [-h] [-D] [-t] [-u] [-m] [-l] [-U] [-F] [-i] [-V] [-T] [-r] [-d destination_file] [-o formatname] [-M FormatterClassName] [-w formatteroption:value] [-n nroff-replacement] [-X] [-L language_code] PageName|ModuleName|ProgramName|URL Examples: perldoc -f BuiltinFunction perldoc -L it -f BuiltinFunction perldoc -q FAQ Keyword perldoc -L fr -q FAQ Keyword perldoc -v PerlVariable perldoc -a PerlAPI C:\>
  • Comment on Strawberry/ActiveState Perl 5.24.1 - Invalid parameter - -R error when invoking perldoc [Resolved]
  • Select or Download Code

Replies are listed 'Best First'.
Re: Strawberry/ActiveState Perl 5.24.1 - Invalid parameter - -R error when invoking perldoc
by dave_the_m (Monsignor) on Feb 17, 2017 at 20:35 UTC
Re: Strawberry/ActiveState Perl 5.24.1 - Invalid parameter - -R error when invoking perldoc
by VinsWorldcom (Prior) on Feb 17, 2017 at 19:52 UTC

    SO IT'S NOT JUST ME!!!

    I don't think I've seen that exact issue, but did notice perldoc behaved differently for me between 5.18 and 5.22.

    I'm on Windows 7 x64 with Strawberry 64-bit versions as described above. I also have GnuWin32 utils installed - including less.exe. I use less.exe as my pager by setting PAGER=less in my Windows environment variables. Less.exe along with other GnuWin32 utils are in C:\usr\bin, which is in my path.

    On 5.18, 'perldoc SOMETHING' worked fine and used less.exe to page. On 5.22, 'perldoc SOMETHING' would just act like 'cat' and spit out the entire POD document scrolling off the screen - not even using 'more'. I started digging and found 2 differences in Pod::Perldoc.

    First is that it's looking for 'perldoc' to exist in 'c:\strawberry\perl\bin', which of course it doesn't - 'perldoc.BAT' exists. So I created a file called 'perldoc' (no extension) which is just 'perldoc.BAT' minus the Windows batch commands so that it's just a regular Perl script.

    Next, looking in Pod::Perldoc (C:\strawberry\perl\lib\Pod\Perldoc.pm), I found line 1933:

    local $ENV{LESS} = defined $ENV{LESS} ? "$ENV{LESS} -R" : "-R";

    -R!!! It's essentially overriding my PAGER=less setting and providing the -R as an option to less.exe to "fix some bug" as documented in line 1932. Of course running 'less -R' from a command prompt in Windows fails for me:

    VinsWorldcom@C:\Users\VinsWorldcom> less -R There is no -R option ("less --help" for help)

    I updated to the latest GnuWin32 version of less.exe and still no -R support. So I just commented out the line in Pod::Perldoc and now it all works fine like it used to. Running 'perldoc SOMETHING' now uses less.exe as my pager again the way it should.

    If you're worried about commenting out the line, you could always wrap it in a conditional - which achieves the same thing:

    if ( $^O ne 'MSWin32' ) { ... }

    Hopefully, this helps you.

Re: Strawberry/ActiveState Perl 5.24.1 - Invalid parameter - -R error when invoking perldoc
by pritesh_ugrankar (Monk) on Feb 17, 2017 at 21:05 UTC

    Hi Monks,

    Thanks for replying. Here is something I noticed. It doesn't happen with Portable Perl version 5.22.1

    C:\portableshell.bat ---------------------------------------------- Welcome to Strawberry Perl Portable Edition! * URL - http://www.strawberryperl.com/ * see README.TXT for more info ---------------------------------------------- Perl executable: C:\Users\ugrankar\Downloads\strawberry-perl-5.22.1.2- +32bit-portable\perl\bin\perl.exe Perl version : 5.22.1 / MSWin32-x86-multi-thread-64int C:\perldoc perldoc NAME perldoc - Look up Perl documentation in Pod format. SYNOPSIS perldoc [-h] [-D] [-t] [-u] [-m] [-l] [-F] [-i] [-V] [-T] [-r] [-d destination_file] [-o formatname] [-M FormatterClassName] [-w formatteroption:value] [-n nroff-replacement] [-X] [-L language_code] PageName|ModuleName|ProgramName|URL Examples: perldoc -f BuiltinFunction perldoc -L it -f BuiltinFunction perldoc -q FAQ Keyword perldoc -L fr -q FAQ Keyword perldoc -v PerlVariable perldoc -a PerlAPI -- More --
Re: Strawberry/ActiveState Perl 5.24.1 - Invalid parameter - -R error when invoking perldoc
by pritesh_ugrankar (Monk) on Feb 28, 2017 at 15:48 UTC

    Hi,

    As given on the strawberry perl site, The perldoc issue is resolved by running the command - cpanm http://strawberryperl.com/package/kmx/perl-modules-patched/Pod-Perldoc-3.27_patched.tar.gz

    I tried the command from my work place and got errors, but came home and tried, it seems to work!! Given below is the output

    C:\>cpanm http://strawberryperl.com/package/kmx/perl-modules-patched/P +od-Perldoc-3.27_patched.tar.gz --> Working on http://strawberryperl.com/package/kmx/perl-modules-patc +hed/Pod-Perldoc-3.27_patched.tar.gz Fetching http://strawberryperl.com/package/kmx/perl-modules-patched/Po +d-Perldoc-3.27_patched.tar.gz ... OK Configuring Pod-Perldoc-3.27 ... OK Building and testing Pod-Perldoc-3.27 ... OK Successfully installed Pod-Perldoc-3.27 1 distribution installed C:\>perldoc perldoc NAME perldoc - Look up Perl documentation in Pod format. SYNOPSIS perldoc [-h] [-D] [-t] [-u] [-m] [-l] [-U] [-F] [-i] [-V] [-T] [-r] [-d destination_file] [-o formatname] [-M FormatterClassName] [-w formatteroption:value] [-n nroff-replacement] [-X] [-L language_code] PageName|ModuleName|ProgramName|URL Examples: perldoc -f BuiltinFunction perldoc -L it -f BuiltinFunction perldoc -q FAQ Keyword perldoc -L fr -q FAQ Keyword perldoc -v PerlVariable perldoc -a PerlAPI C:\>