I did not quite find what I was looking for in that list of modules though I will check on them from to time. The following code seems to do what I want for now.
#!/usr/bin/perl -w use strict; use warnings; use CPAN::Version; # check we have a git repository -d ".git" or die "not a git repository"; -r ".gitignore" or die "This script expects a .gitignore directory"; -r "Changes" or die "Cannot find Changes file"; -r "MANIFEST" or die "Cannot find MANIFEST file"; # although we overwr +ite this we also use it to get the module name my $module = get_module() or die "could not get a module name"; print "Module: $module\n"; my $current_version = get_current_version() or die "could not get a ve +rsion"; print "Current version: $current_version\n"; my $next_version = get_next_version($module) or die "could not get the + next version"; print "Next version: $next_version\n"; die "failed version sanity check: $current_version, $next_version" unl +ess CPAN::Version->vlt($current_version, $next_version); my $today = `date \'\+\%d\-\%m\-\%Y\'`; chomp $today; print "Today: $today\n"; print "Describe the change: "; my $change = <STDIN>; # BAckup and update Changes file `cp Changes Changes.old`; open(CHANGES, ">>Changes") or die "could not open Changes"; print CHANGES "$next_version\t$today\n\t$change\n\n"; close CHANGES; # Generate MANIFEST file by recursing through the directory # and ignoring anything in .gitignore my %ignore = ('.'=>1,'..'=>1,'.git'=>1); { my @ignore = `cat .gitignore`; foreach my $f (@ignore) { chomp $f; $ignore{$f} = 1; } } # Now read the directory and write out the MANIFEST my @files = `find .`; `cp MANIFEST MANIFEST.old`; open(MANIFEST, ">MANIFEST") or die "could not open MANIFEST"; foreach my $f (@files) { chomp $f; $f =~ s/^\.\///; my $print = 1; if ($ignore{$f}) { $print = 0; } else { foreach my $m ($f =~ /(^[^\/]+)\//) { if ($ignore{$m}) { $print = 0; last; } } } $print = 0 if -d $f; print MANIFEST "$f\n" if $print; } close MANIFEST; #__END__; sub get_current_version { my $version = undef; foreach my $c (`cat Changes`) { chomp $c; if ($c =~ /^([\w\.\+\-]+)\s+\d{1,2}\-\d{1,2}\-\d{4}\s*$/) { my $v = CPAN::Version->readable($1); if (!defined($version) or CPAN::Version->vlt($version, $v)) { $version = $v; } else { warn "Version $version succeeded by $v"; } } } return $version; } sub get_next_version { my $module = shift; my $exec = "perl -Ilib -M$module -e\"print \\\$${module}::VERSION\"" +; my $version = `$exec`; return $version; } sub get_module { my $module_file = `grep lib MANIFEST`; # This should look like lib/C +GI/Application/PageLookup.pm\n $module_file =~ /^lib([\/\w]+)+\.pm\s*$/; my $module = $1; # This should look like /CGI/Application/PageLooku +p $module =~ s/\//::/g; # This should look like ::CGI::Application::Pa +geLookup $module =~ /^::(.+)$/; return $1; }

In reply to Re^2: preparing for CPAN from github by SilasTheMonk
in thread preparing for CPAN from github by SilasTheMonk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.