Viewing perldoc output on Win32 - Ideas an Opinions

B

Bob

Chaps, any ideas on what the best way to view perldoc output on win32
is?

I mean pressing space bar, through long docs, and then realising what
you want is a couple of pages back up is a pain in the bumbum.

Anyone got any clever ideas on tools, redirecting output, regex
searching through the output etc?
 
J

John Bokma

Bob said:
Chaps, any ideas on what the best way to view perldoc output on win32
is?

I mean pressing space bar, through long docs, and then realising what
you want is a couple of pages back up is a pain in the bumbum.

Anyone got any clever ideas on tools, redirecting output, regex
searching through the output etc?

How about using Firefox to look at the web pages? They come with the
ActiveState install (file:///C:/Perl/html/index.html)
 
B

Bob

John said:
How about using Firefox to look at the web pages? They come with the
ActiveState install (file:///C:/Perl/html/index.html)

Yep, I know, but I really prefer the immeadiacy of the command line;
ALT-TAB, "perldoc perldsc", mark-text, cntrl-C, ALT-TAB, cntrl-P,
sorted.
Know what I mean?

CMD is (all said and done), way quicker.

I just need a better viewing tool that perldoc would know about, and I
could use that to search through its output. More like a UNIX
environment, I suppose.
 
A

A. Sinan Unur

Yep, I know, but I really prefer the immeadiacy of the command line;
ALT-TAB, "perldoc perldsc", mark-text, cntrl-C, ALT-TAB, cntrl-P,
sorted.
Know what I mean?

CMD is (all said and done), way quicker.

I just need a better viewing tool that perldoc would know about, and I
could use that to search through its output. More like a UNIX
environment, I suppose.

I'll second John. There is nothing wrong with having 20 or so Firefox
tabs open to all the docs you want to look (especially since Firefox has
"find-as-you-type").

For quickies, I have the

PAGER=less

in my environment.

Sinan
 
J

John Bokma

Bob said:
Yep, I know, but I really prefer the immeadiacy of the command line;
ALT-TAB, "perldoc perldsc", mark-text, cntrl-C, ALT-TAB, cntrl-P,
sorted.
Know what I mean?

CMD is (all said and done), way quicker.

I just need a better viewing tool that perldoc would know about, and I
could use that to search through its output. More like a UNIX
environment, I suppose.

I have a crappy, unfinished script that I call from TextPad. If I select a
module name, and execute the script, it gives search results with URLs etc
which I can open in Firefox. Sadly, textpad can't handle # (fragments) in
URLs at the moment (reported this).
 
D

Damian James

Yep, I know, but I really prefer the immeadiacy of the command line;
ALT-TAB, "perldoc perldsc", mark-text, cntrl-C, ALT-TAB, cntrl-P,
sorted.
Know what I mean?

CMD is (all said and done), way quicker.

What's CMD? ;)
I just need a better viewing tool that perldoc would know about, and I
could use that to search through its output. More like a UNIX
environment, I suppose.

Well, you could look around for a better terminal program then cmd.exe
and a better shell than the one cmd.exe proveds, or you could try a unix
environment for w*nd*ws. Have you come across cygwin yet?

--damian (who would have quit IT by now if forced to use the copy-paste
facilities in cmd.exe every day)
 
J

John Bokma

Damian said:
--damian (who would have quit IT by now if forced to use the copy-paste
facilities in cmd.exe every day)

Works for me :) You just have to tweak the default settings of cmd.exe
here and there. I have now nice colors, tab completion and copy/paste is
on: default. Also I made the buffer big.
 
J

Jürgen Exner

Bob said:
Chaps, any ideas on what the best way to view perldoc output on win32
is?

I mean pressing space bar, through long docs, and then realising what
you want is a couple of pages back up is a pain in the bumbum.

Why not just set the "Height" for "Screen Buffer Size" to something like 500
or even 1000 and then just use the scroll bar on the right side to scroll
back up?

jue
 
B

babydoe

Bob viewing online, there is nothing better than Activestate's
html perldocs (to think otherwise means you're a kook :p).

But since the world needs kooks, and since it takes no effort to
repeat the worked examples of Randal Schwartz, pasted below is a
a script that generates an index for all the Perl functions, and
below that again is a script for using Emacs as a pager to access
the pod information on those functions.

%<------------------------------%<-----------------------------------
#!perl
# ex 16_1 llama book 3ed
# Reads through the perlfunc.pod file looking for identifier
# names on =item lines. Then writes to a database showing the
# first line number on which each identifier appears.
# useage: perl ex16_1.plx
use strict; use warnings;
chomp(my $path_to_perlfunc = `perldoc.bat -l perlfunc`);
open my $pf, $path_to_perlfunc or die "Can't open perlfunc.pod: $!";
dbmopen my %DB, "pf_data", 0644 or die "Can't create dbm file: $!";
%DB = (); # wipe out the entire database
while (<$pf>) {
if (/^=item\s+([a-z_]\w*)/i) {
$DB{$1} = $DB{$1} || $.;
}
}
print "Done!\n";
%<------------------------------%<-----------------------------------

%<------------------------------%<-----------------------------------
#!perl
# ex 16_3 llama book 3ed
# Takes a Perl function name on the command line, and launches
# the pager gnuclient to view the perlfunc.pod file at the line
# that first mentions that function.
# useage: perl ex16_3.plx atan2
use strict; use warnings;
chomp(my $path_to_perlfunc = `perldoc.bat -l perlfunc`);
dbmopen my %DB, "pf_data", undef or die "Can't open dbm file: $!";
if ( my $line = $DB{ $ARGV[0] } ) {
exec 'gnuclientw', "+$line", $path_to_perlfunc
or die "Can't exec pager: $!";
} else {
die "Entry unknown: '$ARGV[0]'.\n";
}
%<------------------------------%<-----------------------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,173
Messages
2,570,938
Members
47,474
Latest member
VivianStuk

Latest Threads

Top