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

I am a complete beginner to the world of Perl and programming in general. I am currently trying to use Perl on a PC with Windows and would like to know how I can look at Perl manual pages on a PC. My colleagues keep telling me to look at them but they are working on Unix boxes. Thanks.

Replies are listed 'Best First'.
Re: Perl Man Pages
by pfaut (Priest) on Jan 13, 2003 at 17:28 UTC

    You bring up the perl documentation with the perldoc command. If you have perl installed on your system, open a command window and type perldoc perl for a directory of what's available. For starters, you can:

    • look up help for perl functions with perldoc -f <function>.
    • search for FAQ answers with perldoc -q <search-text>.
    • look up module documentation with perldoc <module-name>.

    If you are using ActivePerl, there should be an entry in your start menu that will start your browser on their html-ized documentation. I'm not sure what other Windows perl distributors provide for documentation.

    --- print map { my ($m)=1<<hex($_)&11?' ':''; $m.=substr('AHJPacehklnorstu',hex($_),1) } split //,'2fde0abe76c36c914586c';
      .. and if all else fails, there's always the online version of perldoc, which has a searchable archive of the perl docs and manpages.

      -- Foxcub

Re: Perl Man Pages
by logan (Curate) on Jan 13, 2003 at 22:33 UTC
    Finally, bite the bullet and buy "Programming Perl" and "The Perl Cookbook". The two are invaluable. Trust me on this, my first two years with Perl, I never closed the Camel Book. When I found "The Perl Cookbook", I had one of those "if only I had known" moments, knowing that learning Perl would have been infinitely easier if I'd had it from Day One.

    -Logan
    "What do I want? I'm an American. I want more."

      Three years ago, I would have agreed with you and I certainly have a few copies of both books lying around, but they are primarily for those quiet moments in the men's room. Nowadays, at the desk, I use perldoc exclusively when I want to look for something and C:/Perl/html/ when I want to browse through pages of docs. Paper is just no substitute, I'm afraid.

      BTW, both are available in digital form, for example here,which is far more useful as you can copy and paste the examples into your program when coding. He he. Instant expert.

      --
      Regards,
      Helgi Briem
      helgi AT decode DOT is

        I beg to differ. I have found that paper is far superior to perldoc. My books are highlighted, personalized, annotated, and can be used to kill spiders. Books clutter my physical desktop, but not my virtual desktop, which is far smaller. When was the last time you tried annotating an html file? Realistically, you can't do it. You'd have to start a separate text file of notes.

        I won't argue that having html and perldoc for documentation isn't useful, because it is. And, true, having both the Perl Bookshelf and the Lincoln Stein CGI book in a digital form has been hugely convenient. Still, I wouldn't give up my books for anything. Sometimes, I just like to (gasp!) walk away from my PC, plunk myself down somewhere else, and read.

        -Logan
        "What do I want? I'm an American. I want more."

          Three years ago, I would have agreed with you and I certainly have a few copies of both books lying around... Nowadays, at the desk, I use perldoc exclusively

        Given that the guy said he's a perl newbie and a programming newbie, the books would almost certainly be better for him.

Re: Perl Man Pages
by Mr. Muskrat (Canon) on Jan 13, 2003 at 20:53 UTC
    If you are using ActiveState Perl, they convert all perldocs to html for you. They have put a shortcut to the documentation in Start > Programs > ActiveState ActivePerl 5.x > Documentation (where 5.x is your particular version).

    Or try one of the following links: Perl installed on C, D.

    Note: you will probably have to copy and paste the url into a new window in order to view it.

      With ActivePerl, and a default configuration, the HTML version of the manual starts at C:\Perl\lib\html\index.html

      It's easier if you open index.html, as the documents are designed to be viewed using frames, with a list of links down the left side of the browser window.

      Opening other documents directly will likely make it harder to navigate.

Re: Perl Man Pages
by Anonymous Monk on Jan 14, 2003 at 04:47 UTC
    had to mention the obvious no one mentioned

    On the command line
    C:\>perldoc perldoc
Re: Perl Man Pages
by Intrepid (Curate) on Jan 14, 2003 at 22:51 UTC

    Online documentation? Of course, `perldoc' is the canonical answer. I believe however that Tom Christianson is perldoc's author and has himself referred to perldoc as "this noisome program" (for a sense of what 'noisome' means please read the entirety of The Lord of the Rings by J.R.R. Tolkien ;-). Just mentioned as background data.

    It doesn't hurt a newbie to *nix-style programming to learn to use man pages, in general, though. I happen to like manpages. GNU feel that the `info' system is superior but good 'ol `man' still does the trick in a pinch. On some systems that I have had, `man' worked considerably better than `perldoc' did.

    A non-ActiveState Perl-Win32 installation might install the actual Perl man pages for you. One such would be the Perl built with Cygwin. So in fact on most *nix boxen and some Winboxen as well, you could type 'man perlfunc' and get the man-ized Perl functions documentation presented by the type formatting system backend behind the `man' command. That backend is a complex many-headed creature referred to variously as 'nroff' and 'troff' and also may involve a sort of wrapper program named 'groff' which is GNU software. So, just FYI, it is actually possible to read manpages on Windows -- not just the Perl manpages (which may well not be there unless you deliberately do something to generate some, 'cause ActivePerl won't), but any manpages at all: a Win32 port of groff is available as a precompiled binary (or download source yourself and build it using free tools like the mingw project provides): find it here at the SourceForge-hosted "Gnu-Win32" project site. With groff and some patience and pluck one can get a manreader working even without an available port of 'man'. I wrote one and it works pretty nicely (it is a shell script).

    Intrepid a.k.a. perlspinr a.k.a. Soren Andersen

      Tom didn't write perldoc, he loathed it! Perldoc was originally written by Andy Dougherty.

      Abigail

      I program using ActivePerl on Win32, but I use perldoc under Cygwin. Why? Because "less" is better. 8)

      Typing "perldoc perltoc", "/term", then "perldoc whatever" means that my hands never have to leave the keyboard. I can alt-tab between my editor, a DOS box, and a Cygwin session without ever having to reach for the mouse, which seems quicker even if it isn't actually quicker.