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

I have a few *.pm files located in my t/data/ directory. These are actual Perl module files that happen to be part of the dataset which is parsed during testing. Some of the modules are from another CPAN distro, some are not released.

I'm gonna assume they will be visible on search.cpan.org because IIRC, that's how the search engine works, and this is my problem because I'd rather not pollute the search results.

Maybe this isn't that big a problem, but OTOH maybe someone have encountered this before.

Any thoughts on how to handle this? Ignore it? Change exension? Move them somewhere?

/J

Replies are listed 'Best First'.
Re: .pm files that aren't part of a distro
by adrianh (Chancellor) on Aug 19, 2005 at 00:55 UTC
    I'm gonna assume they will be visible on search.cpan.org because IIRC, that's how the search engine works, and this is my problem because I'd rather not pollute the search results.

    Then you'll assume incorrectly :-) The indexer ignores *.pm files under t/.

      Excellent! My non-problem is solved :)

      /J

Re: .pm files that aren't part of a distro
by xdg (Monsignor) on Aug 19, 2005 at 02:59 UTC

    It ignores them in "t/" but just in case you ever need to get CPAN to ignore some modules elsewhere, you can add a "noindex" directive to your META.yml file. For example, to ignore .pm files in an "examples/" directory:

    noindex: directory: - examples

    Read the full META.yml spec for details.

    With Module::Build, you just have to add the following to your Build.PL file:

    meta_add => { noindex => { directory => [ qw/examples/ ] } },

    -xdg

    Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.