Skip to content

Commit

Permalink
RT #132935: correctly check VERSIONs in ExtUtils::ParseXS
Browse files Browse the repository at this point in the history
The following version check does not work correctly:

BEGIN { $VERSION = '3.38' }
use ExtUtils::ParseXS::Constants $VERSION;

The reason is that we must use version "literals",
not "variables" in `use Module VERSION`.
For the sake of ease of maintenance,
we use "require" and "->VERSION", instead of "use" here.
  • Loading branch information
skaji authored and Father Chrysostomos committed Mar 5, 2018
1 parent 0c5a5b2 commit 8a89137
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS.pm
Expand Up @@ -12,11 +12,11 @@ use Symbol;
our $VERSION;
BEGIN {
$VERSION = '3.38';
require ExtUtils::ParseXS::Constants; ExtUtils::ParseXS::Constants->VERSION($VERSION);
require ExtUtils::ParseXS::CountLines; ExtUtils::ParseXS::CountLines->VERSION($VERSION);
require ExtUtils::ParseXS::Utilities; ExtUtils::ParseXS::Utilities->VERSION($VERSION);
require ExtUtils::ParseXS::Eval; ExtUtils::ParseXS::Eval->VERSION($VERSION);
}
use ExtUtils::ParseXS::Constants $VERSION;
use ExtUtils::ParseXS::CountLines $VERSION;
use ExtUtils::ParseXS::Utilities $VERSION;
use ExtUtils::ParseXS::Eval $VERSION;
$VERSION = eval $VERSION if $VERSION =~ /_/;

use ExtUtils::ParseXS::Utilities qw(
Expand Down

0 comments on commit 8a89137

Please sign in to comment.