Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

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
[Discipulus]: Eataly vs World(coffe) ;=)
[Discipulus]: shemem i wrote it directly.. but when i tested it i got a lot of 'undefined value..'
[Corion]: Oh, poor Trump can't get a break. Even the Vatican only sends the second in command to greet him...
[shmem]: Discipulus: readdir has the same semantics as readline (a.k.a <>). Have another coffee ☕ ;-)
[Discipulus]: ah! just with my old system perl (5.8.8) was needed
[Corion]: Has anybody toyed around with Mastodon? There is a Perl module for it, but I'm not sure that it's a yak worth chasing
[Corion]: On the upside, maybe running that for my family would be interesting, or at least for myself
[Corion]: I'm not fond of using a server hosted by other people, even if they claim to be GNU ;)

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (8)
As of 2017-05-26 07:31 GMT
Find Nodes?
    Voting Booth?