Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

View local perldoc output as a web page

by roho (Canon)
on Oct 11, 2010 at 15:49 UTC ( #864634=CUFP: print w/replies, xml ) Need Help??

I don't always have access to the internet, but I can always view perldoc output as a web page using the following batch file in Windows. It is vastly superior to view perldoc output as a web page, since you can freely navigate within the content instead of scrolling through the content in a command window.

BTW, I am aware that there is an HTML folder in the "C:\Perl" directory where module documentation is stored, but this approach seemed much cleaner and easier, plus this makes the full range of perldoc output available for viewing as a web page.

rem ******************************************** rem * Name: pm.bat rem * Desc: Display perldoc output as web page. rem ******************************************** @echo off perldoc -m %* | pod2html --quiet > "%APPDATA%\perldoc_temp.htm" del pod2htmd.tmp pod2htmi.tmp start "C:\Program Files\Internet Explorer\iexplore.exe" "%APPDATA%\per +ldoc_temp.htm"

Sample Usage:
pm List::Util

1. I use the environment variable %APPDATA% to point to the working directory because it works in both XP and Vista.
2. I have the "-m" option hard-coded in the batch file. This would be better as an option with default value.
3. I use Internet Explorer, but you can modify the batch file to use the browser of your choice.

"Its not how hard you work, its how much you get done."

Replies are listed 'Best First'.
Re: View local perldoc output as a web page
by Anonymous Monk on Oct 12, 2010 at 07:30 UTC
Re: View local perldoc output as a web page
by elwarren (Curate) on Oct 12, 2010 at 20:46 UTC

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: CUFP [id://864634]
Approved by ww
Front-paged by Arunbear
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (2)
As of 2017-09-25 05:11 GMT
Find Nodes?
    Voting Booth?
    During the recent solar eclipse, I:

    Results (276 votes). Check out past polls.