develooper Front page | perl.perl5.porters | Postings from July 2005

[PATCH lib/Pod/Perldoc.pm] search perlvar with perldoc -a

Thread Next
From:
Ivan Tubert-Brohman
Date:
July 25, 2005 14:57
Subject:
[PATCH lib/Pod/Perldoc.pm] search perlvar with perldoc -a
Message ID:
42E5606E.4000106@cpan.org
Hi,

I sent this to Sean Burke a few days ago. I haven't got any reply, but 
later I noticed that perlhack suggests sending a copy to p5p, so here it is.

-----

I've always wanted to be able to use perldoc to quickly look up a Perl 
predefined variable in perlvar, the same way I can now look up a 
function in perlfunc with perldoc -f. Today I decided to do something 
about it, so I modified my perldoc to do precisely that. I'm attaching 
the patch relative to the Pod-Perldoc-3.14 distribution, in case you are 
interested in adding it to the official version.

The effect of this patch is that you can now use

   perldoc -a '$_'

to look for $_ in perlvar.

I'm not entirely happy with the letter I chose ('a'). Obviously -v or -V 
would be easier to remember, but they were both taken, and they are 
frequently associated with verbosity and version anyway. I chose 'a' 
because its the next letter in vAriable, but if you can come up with 
something better I'm all ears. I also considered making -f look at both 
perlfunc and perlvar, but that is questionable because, of course, 
variables are not functions. ;-)

Cheers,
Ivan (itub@cpan)

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About