solbeach has asked for the wisdom of the Perl Monks concerning the following question:

I'm willing to RTFM, but I can't find the right FM to read. How do I create a pod.idx file? TIA!

Replies are listed 'Best First'.
Re: how to create pod.idx
by osunderdog (Deacon) on Apr 15, 2005 at 19:31 UTC

    I found the following comment in perldoc

    perldoc perldoc ... -X Use an index if it is present -- the -X option looks for an entry whose basename matches the name given on the command line in the file "$Config{archlib}/pod.idx". The pod.idx file should contain fully qualified filenames, one per line. ...

    So it sounds like the pod.idx file contains fully qualified filenames, one per line.


    "Look, Shiny Things!" is not a better business strategy than compatibility and reuse.

      Yes, I read that too. However this file does not exist on any system where Perl is. "Filenames" of which files? I have to believe that there is some PERL source code which will correctly create this file, but I can't find it.

        sobeach writes: "Filenames" of which files?

        The files you want to index.


        s//----->\t/;$~="JAPH";s//\r<$~~/;{s|~$~-|-~$~|||s |-$~~|$~~-|||s,<$~~,<~$~,,s,~$~>,$~~>,, $|=1,select$,,$,,$,,1e-1;print;redo}
Re: how to create pod.idx
by starbolin (Hermit) on Apr 15, 2005 at 23:02 UTC

    pod.idx files are not needed to use Perl or the perldoc system. A pod.idx file simply contains a list of .pod files. To generate a list of pod files on a *nix system you would use:

    locate .pod >filelist

    Although I don't know why you would want to do this. Perhaps if you tell us what you are trying to accomplish?


    s//----->\t/;$~="JAPH";s//\r<$~~/;{s|~$~-|-~$~|||s |-$~~|$~~-|||s,<$~~,<~$~,,s,~$~>,$~~>,, $|=1,select$,,$,,$,,1e-1;print;redo}
Re: how to create pod.idx
by osunderdog (Deacon) on Apr 15, 2005 at 22:36 UTC

    Couldn't find the FM either. Here's the code...I guess this is RTFC ;) It's in Pod::Perldoc. Command line option -X translates to the attribute podidx in the Pod::Perldoc::options_processing method. Pod::Perldoc::grand_search_init is where packages are found matching the search package.

    sub grand_search_init { my($self, $pages, @found) = @_; foreach (@$pages) { if ($self->{'podidx'} && open(PODIDX, $self->{'podidx'})) { my $searchfor = catfile split '::', $_; $self->aside( "Searching for '$searchfor' in $self->{'podi +dx'}\n" ); local $_; while (<PODIDX>) { chomp; push(@found, $_) if m,/$searchfor(?:\.(?:pod|pm))?\z,i +; } close(PODIDX) or die "Can't close $$self{'podid +x'}: $!"; next; } ...

    It looks like the .idx file would speed up searches for package pod if the .idx file existed.

    Hope that helps.


    "Look, Shiny Things!" is not a better business strategy than compatibility and reuse.

Re: how to create pod.idx
by chas (Priest) on Apr 15, 2005 at 23:38 UTC
    Check out this.
    (See the section entitled "Description.")
    chas
Re: how to create pod.idx
by solbeach (Novice) on Apr 17, 2005 at 01:20 UTC
    THANKS for all the responses. find /usr -name \*pod -print > pod.idx
    You can lead {some|many|most} to knowledge, but a few will steadfastly refuse to think (for themsleves). Clue Repellant!
Re: how to create pod.idx
by starbolin (Hermit) on Apr 16, 2005 at 00:13 UTC

    Ok Monks. There exists a one-liner but I am hoping to make him do some of the work himself.


    s//----->\t/;$~="JAPH";s//\r<$~~/;{s|~$~-|-~$~|||s |-$~~|$~~-|||s,<$~~,<~$~,,s,~$~>,$~~>,, $|=1,select$,,$,,$,,1e-1;print;redo}
Re: how to create pod.idx
by naChoZ (Curate) on Apr 16, 2005 at 20:19 UTC

    You should have a look at the perlindex cpan distro and see if that will do what you want.

    --
    "This alcoholism thing, I think it's just clever propaganda produced by people who want you to buy more bottled water." -- pedestrianwolf