Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??

This is an example of using CPAN to distribute a script. The guts are in Pod::Webserver, and a script, podwebserver is supplied to call it.

I came across this module in the first chapter of Perl hacks as Hack #3: "Browse Perl Docs Online". My first thoughts were: "Big deal. There's and ubiquitous internet access."

But, the differences is that CPAN gives you all modules known to person and beast kind, and the latest versions thereof. Podwebserver gives you your modules - just the ones you have installed, and the versions you have installed. It also doesn't care how they got there: make install, PPM install, apt-get install, rsync from installation master or whatever. It will also include your own custom written and installed modules, ones that will never go anywhere near CPAN, provided they contain POD.

Install the module Pod::Webserver, and run the script podwebserver in the background. You will then (after some initialisation) be able to point a browser at port 8020 on the node running podwebserver. You can use a different port number if you specify it from the command line.

This will faithfully reflect @INC, including paths added via $ENV{PERL5LIB}. This is very useful for me in my present work location, as I have a custom hand-picked subset of CPAN (under version control, in a special place pointed to by PERL5LIB) that I make available to other developers.

I've come across (and reported) a bug that there is an undocumented timeout after 5 hours of inactivity. If this is a problem, it's simple to take care of, by wrapping the script in a shell loop.

In reply to Pod::Webserver by rinceWind

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, 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, 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.
  • Log In?

    What's my password?
    Create A New User
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others romping around the Monastery: (3)
    As of 2015-11-26 13:17 GMT
    Find Nodes?
      Voting Booth?

      What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

      Results (699 votes), past polls