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
|