Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

View local perldoc output as a web page

by roho (Bishop)
on Oct 11, 2010 at 15:49 UTC ( [id://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."

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 (Priest) on Oct 12, 2010 at 20:46 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
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?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (2)
As of 2024-04-19 20:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found