Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

perldig(1p) [debian man page]

PERLDIG(1p)						User Contributed Perl Documentation					       PERLDIG(1p)

NAME
perldig - Dig up keywords in the local Perl documentation SYNOPSIS
# Update the index (required before first start) perldig -u # Search for a keyword perldig keyword(s) DESCRIPTION
When using "perldig" for the first time, a new index needs to be created. Just call $ perldig -u and everything happens automatically: A crawler will detect locally installed Perl documentation pages, rummage through the POD and index them. When this initial run has been completed, "perldig" is ready to process search requests: $ perldig frobnicate 1) pod/perlguts.pod 2) pod/perlxstut.pod 3) pod/perlnewmod.pod Enter number of choice: The command above shows a search for the keyword "frobnicate". Yes, that's a word used in the Perl documentation! It shows three hits and asks the user to enter a number between 1 and 3 to open the selected documentation page in a pager program (typically "less"). In there, an in-text search for the expression can be started by using the "/" (slash) command. If two or more keywords are given, the search will yield pages that contain all of them. When searching for phrases, please include quotes (make sure to quote the quotes so the shell doesn't eat them): $ perldig '"floating point"' The underlying swish-e search engine also understands expressions connected via AND and OR: $ perldig "'floating point' AND approximate AND 'real number'" To keep the index up to date, it is probably a good idea to run a cronjob every morning: 00 4 * * * /usr/bin/perldig -u >/dev/null 2>&1 If you can read German, please check out this article in the "Linux- Magazin", where this script was originally published: http://www.linux-magazin.de/Artikel/ausgabe/2003/10/perl/perl.html EXAMPLES
# Update/create the index $ perldig -u $ perldig frobnicate 1) pod/perlguts.pod 2) pod/perlxstut.pod 3) pod/perlnewmod.pod Enter number of choice: 1 [ ... perlguts man page shows ... ] FILES
"perldig" puts the swish-e index files into the folder ".perldig" in the user's home directory. LEGALESE
Copyright 2003-2005 by Mike Schilli, all rights reserved. This program is free software, you can redistribute it and/or modify it under the same terms as Perl itself. AUTHOR
2003, Mike Schilli <m@perlmeister.com> perl v5.12.4 2005-08-22 PERLDIG(1p)

Check Out this Related Man Page

Perldoc::Search(3pm)					User Contributed Perl Documentation				      Perldoc::Search(3pm)

NAME
Perldoc::Search - Index and Search local Perl Documentation SYNOPSIS
####################################### # Command line utility: ####################################### # This is permanent and needs to be performed only once # (or if new documentation gets installed). $ perldig -u # Then, search: $ perldig log AND apache AND connect 1) CGI/Carp.pm 2) CGI/Prototype.pm 3) DBI/Changes.pm 4) DBI/Changes.pm Enter number of choice: ####################################### # API ####################################### use Perldoc::Search; my $searcher = Perldoc::Search->new(); # This is permanent and needs to be performed only once # (or if new documentation gets installed). $searcher->update(); # Then, search: for my $hit ($searcher->search("log AND apache")) { print $hit->path(), " "; } DESCRIPTION
"Perldoc::Search" uses the swish-e engine to index the local Perl documentation. It provides both the command line utility "perldig" and an API to perform searches on the index. It uses "SWISH::API::Common" as the indexing and search engine. Most likely, you will want the command line utility "perldig", please check the documentation that comes with it by calling perldoc perldig In case you're interested in the API, read on. METHODS
"my $searcher = Perldoc::Search-$<gt"new()> Instantiates a searcher object. Usually takes no parameters. If you like to modify the searched directories or want to pass different options to "SWISH::API::Common", go ahead: use Config; my $searcher = Perldoc::Search->new( dirs => [$Config{installsitearch}, $Config{installsitelib}, $Config{installarchlib}, $Config{installprivlib}, ], swish_options => { swish_adm_dir => "$ENV{HOME}/.perldig", } ); "$searcher-"update()> Update the index. This operation might take a couple of minutes. "my @hits = $searcher-"search("log AND apache")> Perform a search on the index with the given query. Returns a list of result objects. # Search documents containing # both "foo" and "bar" for my $hit ($swish->search("foo AND bar")) { print $hit->path(), " "; } LEGALESE
Copyright 2005 by Mike Schilli, all rights reserved. This program is free software, you can redistribute it and/or modify it under the same terms as Perl itself. AUTHOR
2005, Mike Schilli <cpan@perlmeister.com> perl v5.12.4 2011-09-17 Perldoc::Search(3pm)
Man Page