Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

Re^3: Understanding CPAN indexing

by Corion (Pope)
on Jul 16, 2013 at 12:57 UTC ( #1044587=note: print w/replies, xml ) Need Help??

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

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/ had the change that is needed for Foo/ v0.38 , and both of them were distributed starting with Foo/ 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.

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

    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.

Re^4: Understanding CPAN indexing
by vsespb (Chaplain) on Jul 21, 2013 at 19:44 UTC
    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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1044587]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (7)
As of 2017-04-28 14:20 GMT
Find Nodes?
    Voting Booth?
    I'm a fool:

    Results (524 votes). Check out past polls.