Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

View local perldoc output as a web page

by roho (Monsignor)
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

Notes:
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."

Comment on View local perldoc output as a web page
Download Code
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?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: CUFP [id://864634]
Approved by ww
Front-paged by Arunbear
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (10)
As of 2014-09-30 22:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (385 votes), past polls