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.


In reply to Re: Strawberry/ActiveState Perl 5.24.1 - Invalid parameter - -R error when invoking perldoc by VinsWorldcom
in thread Strawberry/ActiveState Perl 5.24.1 - Invalid parameter - -R error when invoking perldoc [Resolved] by pritesh_ugrankar

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.