6

I've uploaded my stasis distribution to PAUSE, but it isn't in the index.

I thought this was because it didn't contain a package, so I added a package declaration to the stasis script in v0.04 like this:

#!/usr/bin/env perl
package stasis;
package main;
...

but it still wasn't indexed.

Is there anyway to get this distribution indexed that doesn't involve creating a boilerplate module file? (e.g. adding lib/stasis.pm to the distribution).

David Farrell
  • 427
  • 6
  • 16
  • 1
    What does the email from Pause say? Maybe move the $VERSION variable into the package, too? – choroba Oct 02 '16 at 21:02
  • I only get the "upload" email from PAUSE, but not the "indexed" email. Interesting suggestion about $VERSION, I believe make is finding the version fine, as it inserts it into META.json. – David Farrell Oct 02 '16 at 21:17
  • 2
    Lowercase names are reserved for pragmas, and you shouldn't be claiming top-level namespaces for yourself!!! – ikegami Oct 03 '16 at 16:33

2 Answers2

7

I believe CPAN does not index scripts.

IMO your best option is to make a module that allows doing programmatically what your script does (and make the script use it).

You could put in a fake module or make it think your script is a module (I think listing it in provides works), but I wouldn't if I were you.

ysth
  • 96,171
  • 6
  • 121
  • 214
  • 2
    Scripts on CPAN usually have their guts in a module named `App::$script_name`. [Example](http://search.cpan.org/perldoc?App::perlbrew) – ikegami Oct 03 '16 at 16:34
  • @DavidFarrell only if by "did the trick" you mean cpan is now lying that there is a stasis module – ysth Oct 05 '16 at 04:16
2

Because your package statement was not in a *.pm file.

The PAUSE indexer is open source. It is a little complicated to unpack, but the regex for extracting a package name in a distribution is in PAUSE::pmfile::packages_per_pmfile, which is a method and a package that is meant to process *.pm files only.

The PAUSE::dist::_index_by_meta method provides the alternate method of declaring a package through the provides keyword in the metafile.

mob
  • 117,087
  • 18
  • 149
  • 283