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
- 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.
Hopefully I haven't left anything out, and I hope at least someone finds this useful besides me ;-)
Another tip: if you can, ditch IIS and install Apache - you'll get a wider group of monks able to help you troubleshoot server issues that way.
Cygwin is the GNU utils. Often a few versions behind, but it's the same stuff.
----
send money to your kernel via the boot loader.. This and more wisdom available from Markov Hardburn.
For some reason, I couldn't get this to work as such on my WinXP machine. In case anyone else has similar problems, I downloaded the zip archive from http://www.greenwoodsoftware.com/less/download.html, which, once unzipped, and when I had adjusted my environment variables, works perfectly.
Thanks for the tip hmerrill++ !
dave
And it came to pass that in time the Great God Om spake unto Brutha, the Chosen One: "Psst!"
(Terry Pratchett, Small Gods)
Ditto++. And by avoiding the cygwin layers, they're faster to boot and easier to tweak.
Brutha wrote:
and is independent of any DLLs
I went back and forth in my head for a while deciding whether to say anything about this or not. I know I'm going to be d/v'ed, that's a foregone conclusion. I just suppose that its the cumulative experience I have in PMo discussions that leads me to open my mouth.
There's a lot of misunderstanding regarding MSWindows and projects that port Perl and other *NIX tools to it, here amongst Perlmonks. I'd estimate that less than 10% of the Monks who open their yaps on such topics actually understand everything they're talking about. {Downvote me NOW, please, and get on with the next node}.
Those *NIX tools are sure not "independent of any DLLs". They are dependent on MSVCRT.DLL. If this file isn't present, they aren't going to work. It's a "native" MSWindows DLL that Cygwin "replaces" (the role, not the actual file) with a "cygwin.dll".
GnuWin32 != Cygwin unxutils != GnuWin32 != Cygwin mingw != GnuWin32 != Cygwin
Hopefully it is a little clearer now. I'd like to see some of the superstition and half-truths prevalent in the Monastery community dispelled wrt Cygwin and the rest of this. Of course for that to really happen, Monks will have to become interested in something besides Perl. I know that few Monks listen to me, because I'm not "nice" and meek and mild-mannered.
It's not just that dll, either. The cygwin gcc uses these:
Found: C:\cygwin\bin\gcc.exe
C:/cygwin/bin/gcc.exe
C:\cygwin\bin\cygwin1.dll
C:\WINDOWS\System32\ADVAPI32.DLL
C:\WINDOWS\System32\ntdll.dll
C:\WINDOWS\System32\KERNEL32.dll
C:\WINDOWS\System32\RPCRT4.dll
C:\cygwin\bin\cygintl-2.dll
C:\cygwin\bin\cygiconv-2.dll
More and more things in cygwin will rely not just on the dll, but on the cygserver service running as time goes on.
perlmonks.org content © perlmonks.org and BrowserUk, Brutha, BUU, hardburn, hmerrill, Intrepid, jZed, Not_a_Number, ysth
prlmnks.org © 2006 edmund von der burg (eccles & toad)
v 0.03