Perldoc::Search(3pm)

πŸ“¦
version 0.01 Β· 2 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble

πŸ’– NAME πŸ’–

Perldoc::Search β€” it indexes and searches your local Perl documentation, bestie. No cap. ✨


🌸 SYNOPSIS 🌸

okok so there are two whole ways to use this, pick ur fighter:

πŸŽ€ Command line utility:

    #######################################
    # 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:

    #######################################
    # 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(), "\n";
    }

πŸ’… DESCRIPTION πŸ’…

Perldoc::Search uses the swish-e engine to index the local Perl documentation, fr fr. It hands you both the command line utility perldig and an API so you can run searches against that index. For the indexing-and-searching heavy lifting it uses SWISH::API::Common. iconic behaviour honestly.

Most likely you're here for the command line utility perldig, so go read the docs that ship with it by running

perldoc perldig

But if you're an API girlie, keep reading. 🫢


⭐ METHODS ⭐

✨ "my $searcher = Perldoc::Search->new()"

Instantiates a searcher object. Usually takes no parameters, she's low maintenance like that. πŸ’…

But if you wanna modify which directories get searched, or pass different options through to SWISH::API::Common, go ahead bestie:

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. Heads up, this operation might take a couple of minutes β€” go get a snack, it's not a big deal. ⏳

✨ "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(), "\n";
     }

πŸ‘‘ 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. (yes this is the whole thing, no notes 😌)


πŸ¦‹ AUTHOR πŸ¦‹

2005, Mike Schilli <cpan@perlmeister.com>


ok that's the whole page bestie, thanks for reading, you're doing amazing sweetie 🌈

this was perl v5.32.0, dated 2021-01-05, and the page is Perldoc::Search(3pm) β€” mwah, bye!! πŸ’œπŸŒΈπŸŽ€

πŸ“¦ where this page comes from