While I understand the desire to be Lazy, wouldn't it be sufficient to use a script like:
((untested, but you get the idea))?#!/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", $_); }
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
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |