Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^2: Understanding CPAN indexing

by vsespb (Chaplain)
on Jul 16, 2013 at 12:52 UTC ( [id://1044585]=note: print w/replies, xml ) Need Help??


in reply to Re: Understanding CPAN indexing
in thread Understanding CPAN indexing

is older, and I'm not sure whether all tools support
Which tools involved into this (except PAUSE)? From pause FAQ:
The PAUSE indexer honours the contents of the no_index and the provides fields.

Next,

Personally, I try to keep a version number in all files, and have the version number identical across all files for each release.
Yes, I saw this in several places. But why exactly? To avoid issue (4) in first post? Or there are other possible issues? Does it make sense for "private" modules?

Replies are listed 'Best First'.
Re^3: Understanding CPAN indexing
by tobyink (Canon) on Jul 16, 2013 at 13:01 UTC

    As I understand it, "provides" beats "no_index". If you want a module to be excluded from CPAN indexes, then you need to make sure it's covered by "no_index" and not included in "provides".

    That said, the main reason you'd normally do that would be for a module that is bundled with your distribution, but not intended for installation. For example, a module that is only needed to run the test suite.

    Modules that are needed for the distribution to run probably ought to be indexed as normal.

    package Cow { use Moo; has name => (is => 'lazy', default => sub { 'Mooington' }) } say Cow->new->name
Re^3: Understanding CPAN indexing
by Corion (Patriarch) on Jul 16, 2013 at 12:57 UTC

    If PAUSE honors both, then you should be able to use whatever you like. I haven't followed closely the changes in how the indexer works and what new features the META* files provide.

    I like keeping one version number across a distribution because that makes it really easy to trace back from where a file originated. There is no room for confusion because I never have to remember whether version 0.17 of Foo/Bar.pm had the change that is needed for Foo/Baz.pm v0.38 , and both of them were distributed starting with Foo/App.pm v0.42 in the 0.42 version of the distribution. This is true for me for both "public" and "private" modules, because when trying to track down an error, it's much easier to ask the other end "What is the version number in the file?" than "What version of the distribution did you install?". Often, a module was installed as a prerequisite so the other end does not even remember explicitly installing a module.

      Further to that, Perl::Version comes with a very handy script called perl-reversion for bulk reversioning a whole distribution. (Which will handily complain loudly if it notices one of your modules is out of sync.)

      package Cow { use Moo; has name => (is => 'lazy', default => sub { 'Mooington' }) } say Cow->new->name

        Indeed. I use perl-reversion, except I patched it for the insane bits where it rewrites the line-endings to become platform-native instead of keeping them as-is. Other than that, it is highly convenient.

      Thanks!
      I probably end up having same version in all modules.
      Immediately after I released "release" CPAN version of my script (previously I had "unzip-and-run" version), one of my users messed up files somehow of old and new version.
      Thus I add version to all files (that solved all of problems in original post, btw), and wrote code like this to check version runtime:
      for (keys %INC) { if (/^App\/MtAws\/(.*)\.pmc?$/) { my $module = "App::MtAws::$1"; my $got = $module->VERSION; $got = 'undef' unless defined $got; die "FATAL: wrong version of $module, expected $VERSION, f +ound $got" unless $got eq $VERSION; } }; }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1044585]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (4)
As of 2024-04-26 08:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found