0

What's the point of this....

our $VERSION = '0.65';
$VERSION = eval $VERSION;

I don't understand how that's different from..

our $VERSION = '0.65';
Evan Carroll
  • 78,363
  • 46
  • 261
  • 468
  • See [eval $VERSION in modules?](http://www.perlmonks.org/?node_id=815646) on PerlMonks (and [Version numbers should be boring](http://www.dagolden.com/index.php/369/version-numbers-should-be-boring/), which is linked from there). – ThisSuitIsBlackNot Apr 05 '16 at 18:19
  • 1
    @EvanCarroll At least you've gone from 0.01 to 0.65? :) –  Apr 05 '16 at 19:00

1 Answers1

1

Try this code...

#!/usr/bin/perl
use strict;
use warnings;

our $VERSION = "0.001_001";
print "$VERSION == 0.001_001\n";
$VERSION = eval $VERSION;
print "$VERSION == 0.001_001\n";

The reason can be found here...

http://www.dagolden.com/index.php/369/version-numbers-should-be-boring/

The above is a long read though, what the eval did was make it possible to compare the VERSION numerically ie it removed the _.

Harry
  • 11,298
  • 1
  • 29
  • 43