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

I've put POD documentation into my Perl script but when I do 'perldoc file.pl' I get a blank page in some type of pager. The pager file says '/tmp/(random letters and numbers)'. I checked several pages viaGoogle and my documentation looks right, as I put a blank line before and after every '=' command. What could I be doing wrong here? Here is a small test.pl file which doesn't even work.


#!/usr/bin/perl # Update date: # Purpose: blah blah blah # # VARIABLES # blah = # foo = # =pod =head1 NAME =head1 SYNOPSIS This is a normal paragraph of text. A second line to test if the paragraph wraps with the previous one. =cut use warnings; use strict; print "Hi\n"; exit;

These also don't work and just give me a blank page in a pager.
  1. perldoc -t test.pl
  2. perldoc -u test.pl
  3. perldoc -v test.pl

and I noticed

  1. $PAGER env var is not defined.
  2. $LESS env var also not defined.
  3. perldoc -T test.pl works as plain text sent to the terminal. So I have a possible problem with something else?
  4. I have groff 1.18.1.1
  5. Bottom of man page for pod2man says "2013-04-17". I didn't see a way to show the version of it.

Thank you.


EDIT: I had to edit my .cshrc, and add a line 'setenv PERLDOC_PAGER /bin/more', save the .cshrc, and source it to make it work. Doing 'setenv PAGER /bin/more' was not enough. I now have both anyway.

Perl 5.8.8 on Redhat Linux RHEL 5.5.56 (64-bit)

Replies are listed 'Best First'.
Re: perldoc POD documenation not working
by toolic (Bishop) on Oct 06, 2014 at 13:23 UTC
    Your code seems to work for me, but I am on Perl v5.12.2. Your version is very old. I recommend updating your Perl version to eliminate this as a variable. Here is what I get:
    perldoc -t test.pl NAME SYNOPSIS This is a normal paragraph of text. A second line to test if the paragraph wraps with the previous one. /tmp/Rr4_NPU0ZN (END)

    I think you can get rid of the =pod . See also: ENVIRONMENT. What about perldoc -T ?

    UPDATE: As it happens, I also have v5.8.8 installed, and I get the same results as I do with 5.12. It works for me with both versions of Perl.

      Oops, Nevermind. Found list of changes for all Perl versions here: http://perldoc.perl.org/index-history.html

      Another question is, can I spider just that page to one level deep to get all the sub pages on my PC? If not, where can I get that page plus one level deep to read offline?

      Perl 5.8.8 on Redhat Linux RHEL 5.5.56 (64-bit)
        The docs are already on your disc. Just use

        perldoc -ohtml

        to get the html version.

        Otherwise wget has depth and mirror options.

        And IIRC perldoc.org can be downloaded as zip.

        Cheers Rolf

        (addicted to the Perl Programming Language and ☆☆☆☆ :)

      Thank you. Is there a way I can get a list of changes to Perl between 5.8.8 and 5.20 in one HTML page? Or that at least contains those changes referenced on one HTML page? I'd have to read them all before considering upgrading Perl on this mission critical machine.

      Perl 5.8.8 on Redhat Linux RHEL 5.5.56 (64-bit)