Tomte has asked for the wisdom of the Perl Monks concerning the following question:
Hi,
to allow for determination exactly which version of a program runs (and produces errors), I have the following statement to fetch the subversion revision-number in my code
While I think its reasonable and not too ugly, I wonder if theres a more concise/elegant way of retrieving the revision-number as a constant.use constant REVISION => eval { ( $_ = '$Id: mcdt.pl 2081 2006-08-25 16:16:27Z tomte $' ) =~ s/\$Id: mcdt.pl (\d+) .*/$1/; $_; };
Edit: elimininated /g modifier
regards,
tomte
An intellectual is someone whose mind watches itself.
-- Albert Camus
Back to
Seekers of Perl Wisdom