Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

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/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.


Comment on Re^3: Understanding CPAN indexing
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 (Hermit) on Jul 21, 2013 at 19:44 UTC
    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
Node Status?
node history
Node Type: note [id://1044587]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (13)
As of 2014-08-01 14:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Who would be the most fun to work for?















    Results (23 votes), past polls