[Pdx-pm] Austin's $VERSION trick

David Wheeler david at kineticode.com
Fri Jul 15 15:28:33 PDT 2005

On Jul 15, 2005, at 2:26 PM, chromatic wrote:

> Yes, including cycling through @INC and all.  I'm not an optimization
> nut, but avoiding unnecessary disk access is good.


> If you set $VERSION, you can use the VERSION method.

Right, that's what I have Bricolage doing:

   require Bric; our $VERSION = Bric->VERSION;

>> And either way, this won't fix those implementations (such as
>> search.cpan.org) that don't evaluate *any* perl code when searching
>> for the version number...
> True.  My distributions include a META.yml file, though.  Is this not
> enough?

No, I think that that probably is enough. But I don't have a solution  
for this for my JavaScript libraries. In fact, all of my CPAN modules  
have the version number hard coded in every module, too. Whenever I  
have a new version, I execute a script to update it:


I recently modified the regex to work with JavaScript library  
versions, too.



More information about the Pdx-pm-list mailing list