Bug#722332: libcommon-sense-perl: common::sense runs into trouble with Perl 5.18, eg. no say().

Hagen Fuchs code at hfuchs.net
Wed Sep 11 10:06:05 UTC 2013


First of all: Nice response time!  I'm always in awe of Debian maintainers'
work ethic.

In response to your last comment,

> I've committed the changes for the first point; reviews welcome!

I'm not sure how I can review those changes?  I `dpkg -i`'d the unstable
version of libcommon-sense-perl, but it's the same thing as before.
What am I missing?

Meanwhile, here's the results of a little investigation of my own:

Executive summary.
This is probably a case for upstream: they'll have to adapt their use of
the '$^H' variable.

Longer version.
The common::sense module's really short, so I tried poking in the source
a bit.  Turns out, there's quite a bit of eye-candy; among those the use
of the magic variable '$^H'.  `perldoc perlvar` says:

     $^H     WARNING: This variable is strictly for internal use only.
     Its availability, behavior, and contents are subject to change
     without notice.

So ... the gods went ahead and changed it, hu?  My best guess for
where to look is feature.pm and the difference between 5.14 and 5.18:

    https://metacpan.org/source/DAPM/perl-5.14.4/lib/feature.pm
    https://metacpan.org/source/RJBS/perl-5.18.1/lib/feature.pm

Rabbit hole!  Turns out, in 5.18, $^H is now initialized(?) with

    $hint_mask    = 0x1c000000;
    [...]
    sub __common {
        [...]
        $^H |= $hint_mask;

And, of course, a few more manglings happen.  Now, simply saying

    sed -i 's|0x820f00|0x1c000000|' /usr/lib/perl5/common/sense.pm

does the trick:

    $ perl -Mcommon::sense -e 'say $common::sense::VERSION; say $^V; say "Hi!";'
    3.72
    v5.18.1
    Hi!

(Mind, this naïve substitution is all kinds of wrong -- this is a bitmask with
definitive meaning and will quite probably still not work for all other
use cases of common::sense (utf8, switch, ...) or even introduce more
subtle errors!)

In conclusion, I hope to have established a case for upstream to become
involved.

Regards,
  Hagen



More information about the pkg-perl-maintainers mailing list