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."
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|