While I understand the desire to be Lazy, wouldn't it be sufficient to use a script like:

#!/usr/bin/perl -w use strict; for (glob '*.pm') { my $ver = sub { sprintf "%04d%02d%02d.%02d%02d%02d", 1900+$_[5], 1+$_[4], @_[3,2,1,0] }->(gmtime +(stat $_)[9]); open IN, '<', $_ or die "Failed to update $_ to $ver"; open OUT, '>' "$_.new" or die "Failed to create $_.new"; while (<IN>) { s:^((our|my|local)\s+)$VERSION\.+=\.+\;:\$VERSION = $ver\;:; print OUT $_; } close IN; close OUT; unlink $_; rename ("$_.new", $_); }
((untested, but you get the idea))?

In this form, it would update $VERSION for all modules in the current directory. I use something like this (more complex, as it updates many things for company code standards), and have had no trouble at all.

Anima Legato
.oO all things connect through the motion of the mind


In reply to Re: create $VERSION from the modtime of the file by legato
in thread create $VERSION from the modtime of the file by merlyn

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.