develooper Front page | perl.perl5.porters | Postings from March 2018

Re: [perl #132935] [PATCH] ExtUtils::ParseXS: use literals forVERSION in 'use Module VERSION'

Thread Next
Shoichi Kaji
March 5, 2018 15:25
Re: [perl #132935] [PATCH] ExtUtils::ParseXS: use literals forVERSION in 'use Module VERSION'
Message ID:
Hi James,

Thanks for your reply.
I think I understand why ExtUtils::ParseXS explicitly require current version of submodules.

My point is here that
we must use "literals" instead of "variables" for version check.

For example, the following code UNEXPECTEDLY prints "NEVER REACH HERE!".

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

my $version;
BEGIN { $version = "99999" }
use HTTP::Tiny $version;


From: James E Keenan via RT <>
Sent: Monday, March 5, 2018 11:24
Subject: [perl #132935] [PATCH] ExtUtils::ParseXS: use literals for VERSION in 'use Module VERSION'

On Sun, 04 Mar 2018 07:10:18 GMT, wrote:
> This is a bug report for perl from,
> generated with the help of perlbug 1.40 running under perl 5.26.1.
> -----------------------------------------------------------------
> [Please describe your issue here]
> Currently in ExtUtils::ParseXS, the version check does not work
> because we use variables for VERSION:
> ```
> our $VERSION;
>   $VERSION = '3.38';
> }
> use ExtUtils::ParseXS::Constants $VERSION;
> ```
> We must use literals for VERSION.
> A patch for this is attached to this e-mail.

Please see the explanation provided by Steffen Mueller in commit 71a65ad3b4b0678fcf5bd6ac3b7ad394accc8079 back in 2011:

ExtUtils::ParseXS: Explicitly require current version of submodules

Since there have been certain problems with parts of ExtUtils::ParseXS being shadowed by older installations of the module, this commit adds an explicit $VERSION to all submodules and requires them to have the same version as the main module. This doesn't actually fix any problem, but makes them more apparent as early as possible instead of failing with obscure compile errors when bad C is generated from the original XS.

Thank you very much.

James E Keenan (

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About