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

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

Thread Next
Ivan Tubert-Brohman
July 25, 2005 14:57
[PATCH lib/Pod/] search perlvar with perldoc -a
Message ID:

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. ;-)

Ivan (itub@cpan)

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About