After working on *nix for the last several years I got used to invoking "perldoc" at the command prompt and having the "less" pager function display the perldoc text. This is nice because "less" give you much more power than the standard Windows "more" pager function. With "less", you can search through the text being displayed, and use the Page Down and Page Up buttons to scroll forwards and backwards through the text. Can't do those things with "more".
So now that I'm on Windows XP, I've been having the hardest time trying to get "less" functionality in "perldoc" so that I can *search* the perldoc text. With an excellent example from Jeff Zucker I've been working on a CGI script that will display the perldocs in the browser which works fine for the example "perldoc DBI", but I've been having problems getting the cgi script to display output for "perldoc perl". Anyway, I just solved the "less" problem - here are the steps I took:1. download the "less" utility from
Hopefully I haven't left anything out, and I hope at least someone finds this useful besides me ;-)- I downloaded the Sources Setup package and ran that and installed "less" to C:\Program Files\GnuWin32 (it installs "less.exe" in the \bin directory) 2. In Control Panel, dbl-click on "System", then click on the "Advanced" tab, and then on the "Environment Variables" button at the bottom. Here I added 2 new "User variables" called PATH and PAGER: PATH C:\Program Files\GnuWin32\bin;%PATH% PAGER "C:\Program Files\GnuWin32\bin\less.exe" 3. Click "Ok" on the Environment Variables dialog 4. Click "Ok" on the "Advanced" tab 5. Exit out of any open Command Prompt windows 6. Bring up a new Command Prompt window, and enter perldoc perl Your should now be able to use - Page Down button (on the keyboard) - Page Up button (on the keyboard) - Search - using the forward slash "/" * if I wanted to search for all occurrences of the word "perl", then I would do "/perl" and press Enter. You should see each occurrence of "perl" hightlighted. Press "n" to advance to the "n"ext occurrence.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: perldoc on WinXP - with "less" instead of "more"
by jZed (Prior) on Jun 29, 2004 at 17:11 UTC | |
by hardburn (Abbot) on Jun 29, 2004 at 20:25 UTC | |
by hmerrill (Friar) on Jun 29, 2004 at 18:43 UTC | |
|
Re: perldoc on WinXP - with "less" instead of "more"
by Brutha (Friar) on Jun 30, 2004 at 09:26 UTC | |
by BrowserUk (Patriarch) on Jun 30, 2004 at 09:38 UTC | |
by Intrepid (Curate) on Jul 05, 2004 at 05:20 UTC | |
by ysth (Canon) on Jul 05, 2004 at 05:29 UTC | |
|
Re: perldoc on WinXP - with "less" instead of "more"
by Not_a_Number (Prior) on Jun 29, 2004 at 17:26 UTC | |
|
Re: perldoc on WinXP - with "less" instead of "more"
by BUU (Prior) on Jun 29, 2004 at 17:06 UTC |