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

I have a package that has a lot of classes in it. Most of these classes are of no interest to the end user, and I am wondering if there is a way to keep them from showing up in the CPAN listings?
-- gam3
A picture is worth a thousand words, but takes 200K.
  • Comment on Hiding classes (package names) from CPAN

Replies are listed 'Best First'.
Re: Hiding classes (package names) from CPAN
by salva (Canon) on Jun 05, 2005 at 10:31 UTC
    I found this trick googling: divide the package declaration in two lines...
    package # avoid cpan indexing Foo::Bar;

      FWIW, I know this works well as it is the trick that DBI uses to hide the DBI::dr, DBI::db and DBI::st packages from CPAN.

      -stvn
Re: Hiding classes (package names) from CPAN
by adrianh (Chancellor) on Jun 05, 2005 at 12:16 UTC
    Most of these classes are of no interest to the end user, and I am wondering if there is a way to keep them from showing up in the CPAN listings?

    You can also use the no_index attribute of your modules META.yml.

Re: Hiding classes (package names) from CPAN
by ambrus (Abbot) on Jun 05, 2005 at 09:53 UTC

    Try putting them in one file (Foo/Bar.pm if you want to release a Foo::Bar module), but in different packages (Foo::Bar::Small, Foo::Bar::Large, Foo::Bar::Strange, etc).

    Of course, this can cause complications if you want to autoload these classes. In that case, put them in separate files and write a very short perldoc for them saying it's an internal module/class. See CGI::Util for an example.