[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [FWP] Elegant ways to pick up the RCS revision



On Fri, Apr 06, 2001 at 11:57:55PM -0400, Bernie Cosell wrote:
> I thought I saw [maybe on c.l.p.misc] a fairly cute/clever way to pick up 
> the RCS revision number...   I can't remember what it was, so I thought 
> I'd ask here.  what I use [as is typical for my code] is dull and 
> straightforward:
> 
> my $version = (split(/ /, '$Revision: $'))[1] ;
> 
> but surely there must be more fun/obscure ways to get that effect..:o)


I always use:

    use vars qw /$VERSION/;
    ($VERSION) = '$Revision: $' =~ /([\d.]+)/;


I don't my the version number; that wouldn't make much sense, unless I
would use it an error message or so. If it's a package variable, it can
be accessed from the outside. It could also be set, but hey, then you get
what you ask for.



Abigail

==== Want to unsubscribe from Fun With Perl?  Well, if you insist...
==== Send email to <fwp-request@technofile.org> with message _body_
====   unsubscribe